From 881a8ae1ffaa83ffb22cf4adb0f27888251d4c15 Mon Sep 17 00:00:00 2001 From: steffnay Date: Sat, 5 Dec 2020 18:04:06 -0800 Subject: [PATCH 01/77] chore: add initial files for launch --- .../google-cloud-dataqna/CODE_OF_CONDUCT.md | 94 ++++++++ packages/google-cloud-dataqna/CONTRIBUTING.md | 65 ++++++ packages/google-cloud-dataqna/LICENSE | 202 ++++++++++++++++++ packages/google-cloud-dataqna/README.md | 1 + packages/google-cloud-dataqna/synth.py | 38 ++++ 5 files changed, 400 insertions(+) create mode 100644 packages/google-cloud-dataqna/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-dataqna/CONTRIBUTING.md create mode 100644 packages/google-cloud-dataqna/LICENSE create mode 100644 packages/google-cloud-dataqna/README.md create mode 100644 packages/google-cloud-dataqna/synth.py diff --git a/packages/google-cloud-dataqna/CODE_OF_CONDUCT.md b/packages/google-cloud-dataqna/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-dataqna/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-dataqna/CONTRIBUTING.md b/packages/google-cloud-dataqna/CONTRIBUTING.md new file mode 100644 index 00000000000..f6c4cf010e3 --- /dev/null +++ b/packages/google-cloud-dataqna/CONTRIBUTING.md @@ -0,0 +1,65 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + gcloud auth application-default login + npm run samples-test + + # Run all system tests. + gcloud auth application-default login + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup diff --git a/packages/google-cloud-dataqna/LICENSE b/packages/google-cloud-dataqna/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-dataqna/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-dataqna/README.md b/packages/google-cloud-dataqna/README.md new file mode 100644 index 00000000000..3665700a48f --- /dev/null +++ b/packages/google-cloud-dataqna/README.md @@ -0,0 +1 @@ +Dataqna: Nodejs Client diff --git a/packages/google-cloud-dataqna/synth.py b/packages/google-cloud-dataqna/synth.py new file mode 100644 index 00000000000..a74f24c953d --- /dev/null +++ b/packages/google-cloud-dataqna/synth.py @@ -0,0 +1,38 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# 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 subprocess +import logging + +logging.basicConfig(level=logging.DEBUG) + +# run the gapic generator +gapic = gcp.GAPICBazel() +versions = ['v1alpha'] +name = 'dataqna' +for version in versions: + library = gapic.node_library(name, version) + s.copy(library, excludes=['package.json']) + +# Copy common templates +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library( + source_location='build/src', versions=['v1alpha'], default_version='v1alpha') +s.copy(templates, excludes=[]) + +node.postprocess_gapic_library() From 0b9b4324584dafbca3f71a1cc5fd7168d38dc664 Mon Sep 17 00:00:00 2001 From: steffnay Date: Wed, 16 Dec 2020 13:17:59 -0800 Subject: [PATCH 02/77] chore: add initial files for launch --- packages/google-cloud-dataqna/synth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/synth.py b/packages/google-cloud-dataqna/synth.py index a74f24c953d..cac12ed9b26 100644 --- a/packages/google-cloud-dataqna/synth.py +++ b/packages/google-cloud-dataqna/synth.py @@ -27,7 +27,7 @@ name = 'dataqna' for version in versions: library = gapic.node_library(name, version) - s.copy(library, excludes=['package.json']) + s.copy(library, excludes=[]) # Copy common templates common_templates = gcp.CommonTemplates() From b32f7af9cbd9a75b19afa5a20641f82e575fd86a Mon Sep 17 00:00:00 2001 From: steffnay Date: Wed, 16 Dec 2020 13:51:32 -0800 Subject: [PATCH 03/77] feat!: initial library stub --- packages/google-cloud-dataqna/.eslintignore | 6 + packages/google-cloud-dataqna/.eslintrc.json | 3 + packages/google-cloud-dataqna/.gitattributes | 4 + packages/google-cloud-dataqna/.gitignore | 14 + packages/google-cloud-dataqna/.jsdoc.js | 55 + packages/google-cloud-dataqna/.mocharc.js | 29 + packages/google-cloud-dataqna/.nycrc | 24 + packages/google-cloud-dataqna/.prettierignore | 6 + packages/google-cloud-dataqna/.prettierrc.js | 17 + .../google-cloud-dataqna/.repo-metadata.json | 13 + packages/google-cloud-dataqna/README.md | 125 +- .../google-cloud-dataqna/api-extractor.json | 369 + .../linkinator.config.json | 12 + packages/google-cloud-dataqna/package.json | 67 + .../dataqna/v1alpha/annotated_string.proto | 103 + .../v1alpha/auto_suggestion_service.proto | 215 + .../cloud/dataqna/v1alpha/question.proto | 401 + .../dataqna/v1alpha/question_service.proto | 162 + .../cloud/dataqna/v1alpha/user_feedback.proto | 59 + .../google-cloud-dataqna/protos/protos.d.ts | 7146 ++++++ .../google-cloud-dataqna/protos/protos.js | 18528 ++++++++++++++++ .../google-cloud-dataqna/protos/protos.json | 1895 ++ .../google-cloud-dataqna/samples/package.json | 23 + .../samples/quickstart.js | 28 + .../samples/test/quickstart.test.js | 32 + packages/google-cloud-dataqna/src/index.ts | 29 + .../v1alpha/auto_suggestion_service_client.ts | 631 + ...auto_suggestion_service_client_config.json | 31 + .../auto_suggestion_service_proto_list.json | 7 + .../src/v1alpha/gapic_metadata.json | 97 + .../google-cloud-dataqna/src/v1alpha/index.ts | 20 + .../src/v1alpha/question_service_client.ts | 958 + .../question_service_client_config.json | 63 + .../v1alpha/question_service_proto_list.json | 7 + packages/google-cloud-dataqna/synth.metadata | 37 + packages/google-cloud-dataqna/synth.py | 2 +- .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 43 + .../system-test/install.ts | 51 + .../gapic_auto_suggestion_service_v1alpha.ts | 451 + .../test/gapic_question_service_v1alpha.ts | 879 + packages/google-cloud-dataqna/tsconfig.json | 19 + .../google-cloud-dataqna/webpack.config.js | 64 + 43 files changed, 32750 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-dataqna/.eslintignore create mode 100644 packages/google-cloud-dataqna/.eslintrc.json create mode 100644 packages/google-cloud-dataqna/.gitattributes create mode 100644 packages/google-cloud-dataqna/.gitignore create mode 100644 packages/google-cloud-dataqna/.jsdoc.js create mode 100644 packages/google-cloud-dataqna/.mocharc.js create mode 100644 packages/google-cloud-dataqna/.nycrc create mode 100644 packages/google-cloud-dataqna/.prettierignore create mode 100644 packages/google-cloud-dataqna/.prettierrc.js create mode 100644 packages/google-cloud-dataqna/.repo-metadata.json create mode 100644 packages/google-cloud-dataqna/api-extractor.json create mode 100644 packages/google-cloud-dataqna/linkinator.config.json create mode 100644 packages/google-cloud-dataqna/package.json create mode 100644 packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/annotated_string.proto create mode 100644 packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/auto_suggestion_service.proto create mode 100644 packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/question.proto create mode 100644 packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/question_service.proto create mode 100644 packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/user_feedback.proto create mode 100644 packages/google-cloud-dataqna/protos/protos.d.ts create mode 100644 packages/google-cloud-dataqna/protos/protos.js create mode 100644 packages/google-cloud-dataqna/protos/protos.json create mode 100644 packages/google-cloud-dataqna/samples/package.json create mode 100644 packages/google-cloud-dataqna/samples/quickstart.js create mode 100644 packages/google-cloud-dataqna/samples/test/quickstart.test.js create mode 100644 packages/google-cloud-dataqna/src/index.ts create mode 100644 packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts create mode 100644 packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client_config.json create mode 100644 packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_proto_list.json create mode 100644 packages/google-cloud-dataqna/src/v1alpha/gapic_metadata.json create mode 100644 packages/google-cloud-dataqna/src/v1alpha/index.ts create mode 100644 packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts create mode 100644 packages/google-cloud-dataqna/src/v1alpha/question_service_client_config.json create mode 100644 packages/google-cloud-dataqna/src/v1alpha/question_service_proto_list.json create mode 100644 packages/google-cloud-dataqna/synth.metadata create mode 100644 packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-dataqna/system-test/install.ts create mode 100644 packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts create mode 100644 packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts create mode 100644 packages/google-cloud-dataqna/tsconfig.json create mode 100644 packages/google-cloud-dataqna/webpack.config.js diff --git a/packages/google-cloud-dataqna/.eslintignore b/packages/google-cloud-dataqna/.eslintignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-dataqna/.eslintignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-dataqna/.eslintrc.json b/packages/google-cloud-dataqna/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-dataqna/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-dataqna/.gitattributes b/packages/google-cloud-dataqna/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-dataqna/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-dataqna/.gitignore b/packages/google-cloud-dataqna/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-dataqna/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-cloud-dataqna/.jsdoc.js b/packages/google-cloud-dataqna/.jsdoc.js new file mode 100644 index 00000000000..630df58a8cf --- /dev/null +++ b/packages/google-cloud-dataqna/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2020 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/data-qna', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-dataqna/.mocharc.js b/packages/google-cloud-dataqna/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-cloud-dataqna/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-dataqna/.nycrc b/packages/google-cloud-dataqna/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-dataqna/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-dataqna/.prettierignore b/packages/google-cloud-dataqna/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-dataqna/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-dataqna/.prettierrc.js b/packages/google-cloud-dataqna/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-dataqna/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-dataqna/.repo-metadata.json b/packages/google-cloud-dataqna/.repo-metadata.json new file mode 100644 index 00000000000..fa91ab382aa --- /dev/null +++ b/packages/google-cloud-dataqna/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "name": "dataqna", + "name_pretty": "Data QnA", + "product_documentation": "https://cloud.google.com/bigquery/docs/dataqna", + "client_documentation": "https://googleapis.dev/python/dataqna/latest", + "issue_tracker": "", + "release_level": "alpha", + "language": "nodejs", + "repo": "googleapis/nodejs-data-qna", + "distribution_name": "@google-cloud/data-qna", + "api_id": "dataqna.googleapis.com", + "requires_billing": true +} diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index 3665700a48f..3e81ac34f98 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -1 +1,124 @@ -Dataqna: Nodejs Client +[//]: # "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 + +# [Data QnA: Node.js Client](https://github.com/googleapis/nodejs-data-qna) + +[![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/@google-cloud/data-qna.svg)](https://www.npmjs.org/package/@google-cloud/data-qna) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-qna/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-qna) + + + + +Dataqna client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-data-qna/blob/master/CHANGELOG.md). + +* [Data QnA Node.js Client API Reference][client-docs] +* [Data QnA Documentation][product-docs] +* [github.com/googleapis/nodejs-data-qna](https://github.com/googleapis/nodejs-data-qna) + +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 Data QnA API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/data-qna +``` + + + + + +The [Data QnA Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + +This library is considered to be in **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-data-qna/blob/master/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its template in this +[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-data-qna/blob/master/LICENSE) + +[client-docs]: https://googleapis.dev/python/dataqna/latest +[product-docs]: https://cloud.google.com/bigquery/docs/dataqna +[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=dataqna.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-dataqna/api-extractor.json b/packages/google-cloud-dataqna/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-dataqna/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-dataqna/linkinator.config.json b/packages/google-cloud-dataqna/linkinator.config.json new file mode 100644 index 00000000000..bff657b4163 --- /dev/null +++ b/packages/google-cloud-dataqna/linkinator.config.json @@ -0,0 +1,12 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://cloud.google.com/bigquery/docs/dataqna", + "https://github.com/googleapis/nodejs-data-qna" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json new file mode 100644 index 00000000000..0ef5fbce0be --- /dev/null +++ b/packages/google-cloud-dataqna/package.json @@ -0,0 +1,67 @@ +{ + "name": "@google-cloud/data-qna", + "version": "0.1.0", + "description": "Data QnA client for Node.js", + "repository": "googleapis/nodejs-data-qna", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google dataqna", + "dataqna", + "auto suggestion service", + "question service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "prelint": "cd samples; npm link ../; npm install", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "samples-test": "cd samples/ && npm link ../ && npm test", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.9.2" + }, + "devDependencies": { + "@types/mocha": "^8.0.4", + "@types/node": "^14.14.10", + "@types/sinon": "^9.0.9", + "c8": "^7.3.5", + "gts": "^3.0.3", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.6", + "linkinator": "^2.7.0", + "mocha": "^8.2.1", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^9.2.1", + "ts-loader": "^8.0.11", + "typescript": "^4.1.2", + "webpack": "^5.9.0", + "webpack-cli": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } +} diff --git a/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/annotated_string.proto b/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/annotated_string.proto new file mode 100644 index 00000000000..d1eb596d176 --- /dev/null +++ b/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/annotated_string.proto @@ -0,0 +1,103 @@ +// 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.dataqna.v1alpha; + +option csharp_namespace = "Google.Cloud.DataQnA.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha;dataqna"; +option java_multiple_files = true; +option java_outer_classname = "AnnotatedStringProto"; +option java_package = "com.google.cloud.dataqna.v1alpha"; +option php_namespace = "Google\\Cloud\\DataQnA\\V1alpha"; +option ruby_package = "Google::Cloud::DataQnA::V1alpha"; + +// Describes string annotation from both semantic and formatting perspectives. +// Example: +// +// User Query: +// +// top countries by population in Africa +// +// 0 4 14 17 28 31 37 +// +// Table Data: +// +// + "country" - dimension +// + "population" - metric +// + "Africa" - value in the "continent" column +// +// text_formatted = `"top countries by population in Africa"` +// +// html_formatted = +// `"top countries by population in Africa"` +// +// ``` +// markups = [ +// {DIMENSION, 4, 12}, // 'countries' +// {METRIC, 17, 26}, // 'population' +// {FILTER, 31, 36} // 'Africa' +// ] +// ``` +// +// Note that html formattings for 'DIMENSION' and 'METRIC' are the same, while +// semantic markups are different. +message AnnotatedString { + // Semantic markup denotes a substring (by index and length) with markup + // information. + message SemanticMarkup { + // The semantic type of the markup substring. + SemanticMarkupType type = 1; + + // Unicode character index of the query. + int32 start_char_index = 2; + + // The length (number of unicode characters) of the markup substring. + int32 length = 3; + } + + // Semantic markup types. + enum SemanticMarkupType { + // No markup type was specified. + MARKUP_TYPE_UNSPECIFIED = 0; + + // Markup for a substring denoting a metric. + METRIC = 1; + + // Markup for a substring denoting a dimension. + DIMENSION = 2; + + // Markup for a substring denoting a filter. + FILTER = 3; + + // Markup for an unused substring. + UNUSED = 4; + + // Markup for a substring containing blocked phrases. + BLOCKED = 5; + + // Markup for a substring that contains terms for row. + ROW = 6; + } + + // Text version of the string. + string text_formatted = 1; + + // HTML version of the string annotation. + string html_formatted = 2; + + // Semantic version of the string annotation. + repeated SemanticMarkup markups = 3; +} diff --git a/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/auto_suggestion_service.proto b/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/auto_suggestion_service.proto new file mode 100644 index 00000000000..dc547819a31 --- /dev/null +++ b/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/auto_suggestion_service.proto @@ -0,0 +1,215 @@ +// 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.dataqna.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataqna/v1alpha/annotated_string.proto"; +import "google/api/client.proto"; + +option csharp_namespace = "Google.Cloud.DataQnA.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha;dataqna"; +option java_multiple_files = true; +option java_outer_classname = "AutoSuggestionServiceProto"; +option java_package = "com.google.cloud.dataqna.v1alpha"; +option php_namespace = "Google\\Cloud\\DataQnA\\V1alpha"; +option ruby_package = "Google::Cloud::DataQnA::V1alpha"; + +// This stateless API provides automatic suggestions for natural language +// queries for the data sources in the provided project and location. +// +// The service provides a resourceless operation `suggestQueries` that can be +// called to get a list of suggestions for a given incomplete query and scope +// (or list of scopes) under which the query is to be interpreted. +// +// There are two types of suggestions, ENTITY for single entity suggestions +// and TEMPLATE for full sentences. By default, both types are returned. +// +// Example Request: +// ``` +// GetSuggestions({ +// parent: "locations/us/projects/my-project" +// scopes: +// "//bigquery.googleapis.com/projects/my-project/datasets/my-dataset/tables/my-table" +// query: "top it" +// }) +// ``` +// +// The service will retrieve information based on the given scope(s) and give +// suggestions based on that (e.g. "top item" for "top it" if "item" is a known +// dimension for the provided scope). +// ``` +// suggestions { +// suggestion_info { +// annotated_suggestion { +// text_formatted: "top item by sum of usd_revenue_net" +// markups { +// type: DIMENSION +// start_char_index: 4 +// length: 4 +// } +// markups { +// type: METRIC +// start_char_index: 19 +// length: 15 +// } +// } +// query_matches { +// start_char_index: 0 +// length: 6 +// } +// } +// suggestion_type: TEMPLATE +// ranking_score: 0.9 +// } +// suggestions { +// suggestion_info { +// annotated_suggestion { +// text_formatted: "item" +// markups { +// type: DIMENSION +// start_char_index: 4 +// length: 2 +// } +// } +// query_matches { +// start_char_index: 0 +// length: 6 +// } +// } +// suggestion_type: ENTITY +// ranking_score: 0.8 +// } +// ``` +service AutoSuggestionService { + option (google.api.default_host) = "dataqna.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Gets a list of suggestions based on a prefix string. + // AutoSuggestion tolerance should be less than 1 second. + rpc SuggestQueries(SuggestQueriesRequest) returns (SuggestQueriesResponse) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}:suggestQueries" + body: "*" + }; + } +} + +// Request for query suggestions. +message SuggestQueriesRequest { + // Required. The parent of the suggestion query is the resource denoting the project and + // location. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The scopes to which this search is restricted. The only supported scope + // pattern is + // `//bigquery.googleapis.com/projects/{GCP-PROJECT-ID}/datasets/{DATASET-ID}/tables/{TABLE-ID}`. + repeated string scopes = 2; + + // User query for which to generate suggestions. If the query is empty, zero + // state suggestions are returned. This allows UIs to display suggestions + // right away, helping the user to get a sense of what a query might look + // like. + string query = 3; + + // The requested suggestion type. Multiple suggestion types can be + // requested, but there is no guarantee that the service will return + // suggestions for each type. Suggestions for a requested type might rank + // lower than suggestions for other types and the service may decide to cut + // these suggestions off. + repeated SuggestionType suggestion_types = 4; +} + +// A suggestion for a query with a ranking score. +message Suggestion { + // Detailed information about the suggestion. + SuggestionInfo suggestion_info = 1; + + // The score of the suggestion. This can be used to define ordering in UI. + // The score represents confidence in the suggestion where higher is better. + // All score values must be in the range [0, 1). + double ranking_score = 2; + + // The type of the suggestion. + SuggestionType suggestion_type = 3; +} + +// Detailed information about the suggestion. +message SuggestionInfo { + // MatchInfo describes which part of suggestion matched with data in user + // typed query. This can be used to highlight matching parts in the UI. This + // is different from the annotations provided in annotated_suggestion. The + // annotated_suggestion provides information about the semantic meaning, while + // this provides information about how it relates to the input. + // + // Example: + // user query: `top products` + // + // ``` + // annotated_suggestion { + // text_formatted = "top product_group" + // html_formatted = "top product_group" + // markups { + // {type: TEXT, start_char_index: 0, length: 3} + // {type: DIMENSION, start_char_index: 4, length: 13} + // } + // } + // + // query_matches { + // { start_char_index: 0, length: 3 } + // { start_char_index: 4, length: 7} + // } + // ``` + message MatchInfo { + // Unicode character index of the string annotation. + int32 start_char_index = 1; + + // Count of unicode characters of this substring. + int32 length = 2; + } + + // Annotations for the suggestion. This provides information about which part + // of the suggestion corresponds to what semantic meaning (e.g. a metric). + AnnotatedString annotated_suggestion = 1; + + // Matches between user query and the annotated string. + repeated MatchInfo query_matches = 2; +} + +// Response to SuggestQueries. +message SuggestQueriesResponse { + // A list of suggestions. + repeated Suggestion suggestions = 1; +} + +// The type of suggestion. +enum SuggestionType { + // No suggestiont type is specified. + SUGGESTION_TYPE_UNSPECIFIED = 0; + + // Entity suggestion type. Suggestions are for single entities. + ENTITY = 1; + + // Template suggestion type. Suggestions are for full sentences. + TEMPLATE = 2; +} diff --git a/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/question.proto b/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/question.proto new file mode 100644 index 00000000000..7478adfd7fd --- /dev/null +++ b/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/question.proto @@ -0,0 +1,401 @@ +// 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.dataqna.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataqna/v1alpha/annotated_string.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.DataQnA.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha;dataqna"; +option java_multiple_files = true; +option java_outer_classname = "QuestionProto"; +option java_package = "com.google.cloud.dataqna.v1alpha"; +option php_namespace = "Google\\Cloud\\DataQnA\\V1alpha"; +option ruby_package = "Google::Cloud::DataQnA::V1alpha"; + +// The question resource represents a natural language query, its settings, +// understanding generated by the system, and answer retrieval status. +// A question cannot be modified. +message Question { + option (google.api.resource) = { + type: "dataqna.googleapis.com/Question" + pattern: "projects/{project}/locations/{location}/questions/{question}" + }; + + // Output only. Immutable. The unique identifier for the Question. The ID is server-generated. + // Example: `projects/foo/locations/bar/questions/123` + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. Scopes to be used for the question. A scope defines the relevant data set + // scope. It can be a reference to a specific data source or a collection of + // data sources. Currently, support is limited to a single BigQuery table. + // There must be exactly one `scopes` element. + // + // Example: + // `//bigquery.googleapis.com/projects/test-project/datasets/foo/tables/bar` + repeated string scopes = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The query in natural language. + string query = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // A list of annotations to use instead of the default annotation of a data + // source (set in the data source reference resource). There must not be + // more than one annotation with the same data source reference. + repeated string data_source_annotations = 4; + + // An error field explaining why interpretation failed. This is only populated + // if the interpretation failed. + // + // Note: This is different from getting a status error on the request itself. + // This is not a client or server error and the Question resource is still + // persisted, but the service could not interpret the question. Clients should + // present the error to the user so the user can rephrase the question. + InterpretError interpret_error = 5; + + // A list of interpretations for this question. + repeated Interpretation interpretations = 6; + + // Time when the question was created. + google.protobuf.Timestamp create_time = 7; + + // Output only. The e-mail address of the user that created this question. + string user_email = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Immutable. Flags to request additional information for debugging purposes. + DebugFlags debug_flags = 9 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Top level debug information. + // This will be stored as the type DebugInformation. + // Using Any so clients don't need to pull in anything + // inside the debug message. + google.protobuf.Any debug_info = 10; +} + +// Details on the failure to interpret the question. +message InterpretError { + // Details on interpretation failure. + message InterpretErrorDetails { + // Populated if parts of the query are unsupported. + InterpretUnsupportedDetails unsupported_details = 1; + + // Populated if the query is incomplete. + InterpretIncompleteQueryDetails incomplete_query_details = 2; + + // Populated if the query was too ambiguous. + InterpretAmbiguityDetails ambiguity_details = 3; + } + + // Details about unsupported parts in a query. + message InterpretUnsupportedDetails { + // Unsupported operators. For example: median. + repeated string operators = 1; + + // Unsupported intents. + repeated string intent = 2; + } + + // Details about an incomplete query. + message InterpretIncompleteQueryDetails { + // List of missing interpret entities. + repeated InterpretEntity entities = 1; + } + + // Details about a query that was too ambiguous. Currently, the message + // has no fields and its presence signals that there was ambiguity. + message InterpretAmbiguityDetails { + + } + + // The interpret error code provides an error category why the interpretation + // failed. + enum InterpretErrorCode { + // No interpret error code was specified. + INTERPRET_ERROR_CODE_UNSPECIFIED = 0; + + // The query is not valid. + INVALID_QUERY = 1; + + // The interpreter failed to understand the question. For example, because + // it was too ambiguous. + FAILED_TO_UNDERSTAND = 2; + + // The interpreter could understand the question, but was not able to arrive + // at an answer. For example, because a requested operation is not + // supported. + FAILED_TO_ANSWER = 3; + } + + // Error message explaining why this question could not be interpreted. + string message = 1; + + // The code for the error category why the interpretation failed. + InterpretErrorCode code = 2; + + // Details on interpretation failure. + InterpretErrorDetails details = 3; +} + +// Information about the backend status (such as BigQuery) of the execution. +message ExecutionInfo { + // Enum of possible job execution statuses. + enum JobExecutionState { + // No job execution was specified. + JOB_EXECUTION_STATE_UNSPECIFIED = 0; + + // No job execution was requested, yet. + NOT_EXECUTED = 1; + + // The job is running. + RUNNING = 2; + + // The job completed successfully. + SUCCEEDED = 3; + + // The job completed unsuccessfully. + FAILED = 4; + } + + // Status returned by the backend when the job was created. + google.rpc.Status job_creation_status = 1; + + // Status of the job execution. + JobExecutionState job_execution_state = 2; + + // Time when the execution was triggered. + google.protobuf.Timestamp create_time = 3; + + // BigQuery job information. + // Future versions will have different backends. Hence, clients must make sure + // they can handle it when this field is not populated. + BigQueryJob bigquery_job = 4; +} + +// BigQuery job information. This can be used to query the BigQuery API and +// retrieve the current job's status (using +// [jobs.get](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get)). +message BigQueryJob { + // The job ID. + string job_id = 1; + + // The project ID of the job. + string project_id = 2; + + // The location where the job is running. + string location = 3; +} + +// An interpretation of a natural language query. +message Interpretation { + // List of data sources used in the current understanding. + repeated string data_sources = 1; + + // The level of confidence that one of the interpretations is correct. This is + // a value in the range [0, 1] where a value of 0.5 or below is to be + // considered a low confidence. + double confidence = 2; + + // A list of unused phrases. Clients should display a Did You Mean (DYM) + // dialog if this is non-empty, even if this is the only interpretation. + repeated string unused_phrases = 3; + + // Human readable representation of the query. + HumanReadable human_readable = 4; + + // Information about the interpretation structure that helps to understand and + // visualize the response. + InterpretationStructure interpretation_structure = 5; + + // Representation of the data query to be sent to the backend. + DataQuery data_query = 6; + + // Information about the backend response. This is populated only if execution + // of an interpretation was requested. + ExecutionInfo execution_info = 7; +} + +// Representation of the data query for the backend. +// This is provided for informational purposes only. Clients should not use +// it to send it to the backend directly, but rather use the `execute` RPC +// to trigger the execution. Using the `execute` RPC is needed in order to +// track the state of a question and report on it correctly to the data +// administrators. +message DataQuery { + // The generated SQL query to be sent to the backend. + string sql = 1; +} + +// Human readable interpretation. +message HumanReadable { + // Generated query explaining the interpretation. + AnnotatedString generated_interpretation = 1; + + // Annotations on the original query. + AnnotatedString original_question = 2; +} + +// Information about the interpretation structure that helps to understand and +// visualize the response. +message InterpretationStructure { + // Information about a column. + message ColumnInfo { + // The alias of the output column as used by the backend. For example, the + // field name in the schema provided in the query response in BigQuery. + string output_alias = 1; + + // Human readable name of the output column. + string display_name = 2; + } + + // Enumeration of visualzation types to use for query response data. + enum VisualizationType { + // No visualization type was specified. + VISUALIZATION_TYPE_UNSPECIFIED = 0; + + // Show a table. + TABLE = 1; + + // Show a [bar + // chart](https://developers.google.com/chart/interactive/docs/gallery/barchart). + BAR_CHART = 2; + + // Show a [column + // chart](https://developers.google.com/chart/interactive/docs/gallery/columnchart). + COLUMN_CHART = 3; + + // Show a + // [timeline](https://developers.google.com/chart/interactive/docs/gallery/timeline). + TIMELINE = 4; + + // Show a [scatter + // plot](https://developers.google.com/chart/interactive/docs/gallery/scatterchart). + SCATTER_PLOT = 5; + + // Show a [pie + // chart](https://developers.google.com/chart/interactive/docs/gallery/piechart). + PIE_CHART = 6; + + // Show a [line + // chart](https://developers.google.com/chart/interactive/docs/gallery/linechart). + LINE_CHART = 7; + + // Show an [area + // chart](https://developers.google.com/chart/interactive/docs/gallery/areachart). + AREA_CHART = 8; + + // Show a [combo + // chart](https://developers.google.com/chart/interactive/docs/gallery/combochart). + COMBO_CHART = 9; + + // Show a + // [histogram](https://developers.google.com/chart/interactive/docs/gallery/histogram). + HISTOGRAM = 10; + + // This denotes queries when the user has not specified the particular type + // of chart and has mentioned only a generic chart name such as "Chart", + // "Plot", "Graph", etc. This will differentiate it from specific charting + // terms such as "Bar chart", "Pie chart", etc. + GENERIC_CHART = 11; + + // The user tried to specify a chart type, but the interpreter could not + // understand the type. The client should display a generic chart and may + // give a hint to the user that the requested type was not understood. + CHART_NOT_UNDERSTOOD = 12; + } + + // List of possible visualization types to apply for this interpretation. The + // order has no relevance. + repeated VisualizationType visualization_types = 1; + + // Information about the output columns, that is, the columns that will be + // returned by the backend. + repeated ColumnInfo column_info = 2; +} + +// Configuriation of debug flags. +message DebugFlags { + // Whether to include the original VAQuery. + bool include_va_query = 1; + + // Whether to include the original nested VAQuery. + bool include_nested_va_query = 2; + + // Whether to include the original human interpretation strings generated + // by Analyza. + bool include_human_interpretation = 3; + + // Whether to include the Aqua debug response. + bool include_aqua_debug_response = 4; + + // The time in milliseconds from Unix epoch to be used + // to process the query. This is useful for testing + // the queries at different time period. + // If not set or time_override <= 0, then the current + // time is used. + int64 time_override = 5; + + // Set to true if request is initiated by an internal Google user. + bool is_internal_google_user = 6; + + // Determines whether cache needs to be ignored. If set to + // true, cache won't be queried and updated. + bool ignore_cache = 7; + + // Whether to include the request/response pair from the call to the + // EntityIndex for SearchEntities. + bool include_search_entities_rpc = 8; + + // Whether to include the request/response pair from the call to the + // Annotations service for ListColumnAnnotations. + bool include_list_column_annotations_rpc = 9; + + // Whether to include the entity list passed to Analyza. + bool include_virtual_analyst_entities = 10; + + // Whether to include the table list. + bool include_table_list = 11; + + // Whether to include the domain list. + bool include_domain_list = 12; +} + +// Query entities of an interpretation. +enum InterpretEntity { + // No interpret entity was specified. + INTERPRET_ENTITY_UNSPECIFIED = 0; + + // A dimenstion entity. + DIMENSION = 1; + + // A metric entity. + METRIC = 2; +} diff --git a/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/question_service.proto b/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/question_service.proto new file mode 100644 index 00000000000..d92ac1275a7 --- /dev/null +++ b/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/question_service.proto @@ -0,0 +1,162 @@ +// 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.dataqna.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataqna/v1alpha/question.proto"; +import "google/cloud/dataqna/v1alpha/user_feedback.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.DataQnA.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha;dataqna"; +option java_multiple_files = true; +option java_outer_classname = "QuestionServiceProto"; +option java_package = "com.google.cloud.dataqna.v1alpha"; +option php_namespace = "Google\\Cloud\\DataQnA\\V1alpha"; +option ruby_package = "Google::Cloud::DataQnA::V1alpha"; + +// Service to interpret natural language queries. +// The service allows to create `Question` resources that are interpreted and +// are filled with one or more interpretations if the question could be +// interpreted. Once a `Question` resource is created and has at least one +// interpretation, an interpretation can be chosen for execution, which +// triggers a query to the backend (for BigQuery, it will create a job). +// Upon successful execution of that interpretation, backend specific +// information will be returned so that the client can retrieve the results +// from the backend. +// +// The `Question` resources are named `projects/*/locations/*/questions/*`. +// +// The `Question` resource has a singletion sub-resource `UserFeedback` named +// `projects/*/locations/*/questions/*/userFeedback`, which allows access to +// user feedback. +service QuestionService { + option (google.api.default_host) = "dataqna.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Gets a previously created question. + rpc GetQuestion(GetQuestionRequest) returns (Question) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/questions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a question. + rpc CreateQuestion(CreateQuestionRequest) returns (Question) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/questions" + body: "question" + }; + option (google.api.method_signature) = "parent,question"; + } + + // Executes an interpretation. + rpc ExecuteQuestion(ExecuteQuestionRequest) returns (Question) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/questions/*}:execute" + body: "*" + }; + option (google.api.method_signature) = "name,interpretation_index"; + } + + // Gets previously created user feedback. + rpc GetUserFeedback(GetUserFeedbackRequest) returns (UserFeedback) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/questions/*/userFeedback}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates user feedback. This creates user feedback if there was none before + // (upsert). + rpc UpdateUserFeedback(UpdateUserFeedbackRequest) returns (UserFeedback) { + option (google.api.http) = { + patch: "/v1alpha/{user_feedback.name=projects/*/locations/*/questions/*/userFeedback}" + body: "user_feedback" + }; + option (google.api.method_signature) = "user_feedback,update_mask"; + } +} + +// A request to get a previously created question. +message GetQuestionRequest { + // Required. The unique identifier for the question. + // Example: `projects/foo/locations/bar/questions/1234` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataqna.googleapis.com/Question" + } + ]; + + // The list of fields to be retrieved. + google.protobuf.FieldMask read_mask = 2; +} + +// Request to create a question resource. +message CreateQuestionRequest { + // Required. The name of the project this data source reference belongs to. + // Example: `projects/foo/locations/bar` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The question to create. + Question question = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to execute an interpretation. +message ExecuteQuestionRequest { + // Required. The unique identifier for the question. + // Example: `projects/foo/locations/bar/questions/1234` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Index of the interpretation to execute. + int32 interpretation_index = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to get user feedback. +message GetUserFeedbackRequest { + // Required. The unique identifier for the user feedback. + // User feedback is a singleton resource on a Question. + // Example: `projects/foo/locations/bar/questions/1234/userFeedback` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataqna.googleapis.com/UserFeedback" + } + ]; +} + +// Request to updates user feedback. +message UpdateUserFeedbackRequest { + // Required. The user feedback to update. This can be called even if there is no + // user feedback so far. + // The feedback's name field is used to identify the user feedback (and the + // corresponding question) to update. + UserFeedback user_feedback = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} diff --git a/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/user_feedback.proto b/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/user_feedback.proto new file mode 100644 index 00000000000..9749d49e70f --- /dev/null +++ b/packages/google-cloud-dataqna/protos/google/cloud/dataqna/v1alpha/user_feedback.proto @@ -0,0 +1,59 @@ +// 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.dataqna.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.DataQnA.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha;dataqna"; +option java_multiple_files = true; +option java_outer_classname = "UserFeedbackProto"; +option java_package = "com.google.cloud.dataqna.v1alpha"; +option php_namespace = "Google\\Cloud\\DataQnA\\V1alpha"; +option ruby_package = "Google::Cloud::DataQnA::V1alpha"; + +// Feedback provided by a user. +message UserFeedback { + option (google.api.resource) = { + type: "dataqna.googleapis.com/UserFeedback" + pattern: "projects/{project}/locations/{location}/questions/{question}/userFeedback" + }; + + // Enumeration of feedback ratings. + enum UserFeedbackRating { + // No rating was specified. + USER_FEEDBACK_RATING_UNSPECIFIED = 0; + + // The user provided positive feedback. + POSITIVE = 1; + + // The user provided negative feedback. + NEGATIVE = 2; + } + + // Required. The unique identifier for the user feedback. + // User feedback is a singleton resource on a Question. + // Example: `projects/foo/locations/bar/questions/1234/userFeedback` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Free form user feedback, such as a text box. + string free_form_feedback = 2; + + // The user feedback rating + UserFeedbackRating rating = 3; +} diff --git a/packages/google-cloud-dataqna/protos/protos.d.ts b/packages/google-cloud-dataqna/protos/protos.d.ts new file mode 100644 index 00000000000..d9c3422a707 --- /dev/null +++ b/packages/google-cloud-dataqna/protos/protos.d.ts @@ -0,0 +1,7146 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as Long from "long"; +import {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace dataqna. */ + namespace dataqna { + + /** Namespace v1alpha. */ + namespace v1alpha { + + /** Properties of an AnnotatedString. */ + interface IAnnotatedString { + + /** AnnotatedString textFormatted */ + textFormatted?: (string|null); + + /** AnnotatedString htmlFormatted */ + htmlFormatted?: (string|null); + + /** AnnotatedString markups */ + markups?: (google.cloud.dataqna.v1alpha.AnnotatedString.ISemanticMarkup[]|null); + } + + /** Represents an AnnotatedString. */ + class AnnotatedString implements IAnnotatedString { + + /** + * Constructs a new AnnotatedString. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IAnnotatedString); + + /** AnnotatedString textFormatted. */ + public textFormatted: string; + + /** AnnotatedString htmlFormatted. */ + public htmlFormatted: string; + + /** AnnotatedString markups. */ + public markups: google.cloud.dataqna.v1alpha.AnnotatedString.ISemanticMarkup[]; + + /** + * Creates a new AnnotatedString instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotatedString instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IAnnotatedString): google.cloud.dataqna.v1alpha.AnnotatedString; + + /** + * Encodes the specified AnnotatedString message. Does not implicitly {@link google.cloud.dataqna.v1alpha.AnnotatedString.verify|verify} messages. + * @param message AnnotatedString message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IAnnotatedString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotatedString message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.AnnotatedString.verify|verify} messages. + * @param message AnnotatedString message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IAnnotatedString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotatedString message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotatedString + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.AnnotatedString; + + /** + * Decodes an AnnotatedString message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotatedString + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.AnnotatedString; + + /** + * Verifies an AnnotatedString message. + * @param message Plain 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 AnnotatedString message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotatedString + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.AnnotatedString; + + /** + * Creates a plain object from an AnnotatedString message. Also converts values to other types if specified. + * @param message AnnotatedString + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.AnnotatedString, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotatedString to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AnnotatedString { + + /** Properties of a SemanticMarkup. */ + interface ISemanticMarkup { + + /** SemanticMarkup type */ + type?: (google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkupType|keyof typeof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkupType|null); + + /** SemanticMarkup startCharIndex */ + startCharIndex?: (number|null); + + /** SemanticMarkup length */ + length?: (number|null); + } + + /** Represents a SemanticMarkup. */ + class SemanticMarkup implements ISemanticMarkup { + + /** + * Constructs a new SemanticMarkup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.AnnotatedString.ISemanticMarkup); + + /** SemanticMarkup type. */ + public type: (google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkupType|keyof typeof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkupType); + + /** SemanticMarkup startCharIndex. */ + public startCharIndex: number; + + /** SemanticMarkup length. */ + public length: number; + + /** + * Creates a new SemanticMarkup instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticMarkup instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.AnnotatedString.ISemanticMarkup): google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup; + + /** + * Encodes the specified SemanticMarkup message. Does not implicitly {@link google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup.verify|verify} messages. + * @param message SemanticMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.AnnotatedString.ISemanticMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SemanticMarkup message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup.verify|verify} messages. + * @param message SemanticMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.AnnotatedString.ISemanticMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticMarkup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SemanticMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup; + + /** + * Decodes a SemanticMarkup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SemanticMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup; + + /** + * Verifies a SemanticMarkup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SemanticMarkup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SemanticMarkup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup; + + /** + * Creates a plain object from a SemanticMarkup message. Also converts values to other types if specified. + * @param message SemanticMarkup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SemanticMarkup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** SemanticMarkupType enum. */ + enum SemanticMarkupType { + MARKUP_TYPE_UNSPECIFIED = 0, + METRIC = 1, + DIMENSION = 2, + FILTER = 3, + UNUSED = 4, + BLOCKED = 5, + ROW = 6 + } + } + + /** Represents an AutoSuggestionService */ + class AutoSuggestionService extends $protobuf.rpc.Service { + + /** + * Constructs a new AutoSuggestionService 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 AutoSuggestionService 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): AutoSuggestionService; + + /** + * Calls SuggestQueries. + * @param request SuggestQueriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SuggestQueriesResponse + */ + public suggestQueries(request: google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, callback: google.cloud.dataqna.v1alpha.AutoSuggestionService.SuggestQueriesCallback): void; + + /** + * Calls SuggestQueries. + * @param request SuggestQueriesRequest message or plain object + * @returns Promise + */ + public suggestQueries(request: google.cloud.dataqna.v1alpha.ISuggestQueriesRequest): Promise; + } + + namespace AutoSuggestionService { + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.AutoSuggestionService#suggestQueries}. + * @param error Error, if any + * @param [response] SuggestQueriesResponse + */ + type SuggestQueriesCallback = (error: (Error|null), response?: google.cloud.dataqna.v1alpha.SuggestQueriesResponse) => void; + } + + /** Properties of a SuggestQueriesRequest. */ + interface ISuggestQueriesRequest { + + /** SuggestQueriesRequest parent */ + parent?: (string|null); + + /** SuggestQueriesRequest scopes */ + scopes?: (string[]|null); + + /** SuggestQueriesRequest query */ + query?: (string|null); + + /** SuggestQueriesRequest suggestionTypes */ + suggestionTypes?: (google.cloud.dataqna.v1alpha.SuggestionType[]|null); + } + + /** Represents a SuggestQueriesRequest. */ + class SuggestQueriesRequest implements ISuggestQueriesRequest { + + /** + * Constructs a new SuggestQueriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.ISuggestQueriesRequest); + + /** SuggestQueriesRequest parent. */ + public parent: string; + + /** SuggestQueriesRequest scopes. */ + public scopes: string[]; + + /** SuggestQueriesRequest query. */ + public query: string; + + /** SuggestQueriesRequest suggestionTypes. */ + public suggestionTypes: google.cloud.dataqna.v1alpha.SuggestionType[]; + + /** + * Creates a new SuggestQueriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestQueriesRequest instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.ISuggestQueriesRequest): google.cloud.dataqna.v1alpha.SuggestQueriesRequest; + + /** + * Encodes the specified SuggestQueriesRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestQueriesRequest.verify|verify} messages. + * @param message SuggestQueriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestQueriesRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestQueriesRequest.verify|verify} messages. + * @param message SuggestQueriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestQueriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.SuggestQueriesRequest; + + /** + * Decodes a SuggestQueriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.SuggestQueriesRequest; + + /** + * Verifies a SuggestQueriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestQueriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestQueriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.SuggestQueriesRequest; + + /** + * Creates a plain object from a SuggestQueriesRequest message. Also converts values to other types if specified. + * @param message SuggestQueriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.SuggestQueriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestQueriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Suggestion. */ + interface ISuggestion { + + /** Suggestion suggestionInfo */ + suggestionInfo?: (google.cloud.dataqna.v1alpha.ISuggestionInfo|null); + + /** Suggestion rankingScore */ + rankingScore?: (number|null); + + /** Suggestion suggestionType */ + suggestionType?: (google.cloud.dataqna.v1alpha.SuggestionType|keyof typeof google.cloud.dataqna.v1alpha.SuggestionType|null); + } + + /** Represents a Suggestion. */ + class Suggestion implements ISuggestion { + + /** + * Constructs a new Suggestion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.ISuggestion); + + /** Suggestion suggestionInfo. */ + public suggestionInfo?: (google.cloud.dataqna.v1alpha.ISuggestionInfo|null); + + /** Suggestion rankingScore. */ + public rankingScore: number; + + /** Suggestion suggestionType. */ + public suggestionType: (google.cloud.dataqna.v1alpha.SuggestionType|keyof typeof google.cloud.dataqna.v1alpha.SuggestionType); + + /** + * Creates a new Suggestion instance using the specified properties. + * @param [properties] Properties to set + * @returns Suggestion instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.ISuggestion): google.cloud.dataqna.v1alpha.Suggestion; + + /** + * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dataqna.v1alpha.Suggestion.verify|verify} messages. + * @param message Suggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.Suggestion.verify|verify} messages. + * @param message Suggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Suggestion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.Suggestion; + + /** + * Decodes a Suggestion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.Suggestion; + + /** + * Verifies a Suggestion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Suggestion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.Suggestion; + + /** + * Creates a plain object from a Suggestion message. Also converts values to other types if specified. + * @param message Suggestion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.Suggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Suggestion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestionInfo. */ + interface ISuggestionInfo { + + /** SuggestionInfo annotatedSuggestion */ + annotatedSuggestion?: (google.cloud.dataqna.v1alpha.IAnnotatedString|null); + + /** SuggestionInfo queryMatches */ + queryMatches?: (google.cloud.dataqna.v1alpha.SuggestionInfo.IMatchInfo[]|null); + } + + /** Represents a SuggestionInfo. */ + class SuggestionInfo implements ISuggestionInfo { + + /** + * Constructs a new SuggestionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.ISuggestionInfo); + + /** SuggestionInfo annotatedSuggestion. */ + public annotatedSuggestion?: (google.cloud.dataqna.v1alpha.IAnnotatedString|null); + + /** SuggestionInfo queryMatches. */ + public queryMatches: google.cloud.dataqna.v1alpha.SuggestionInfo.IMatchInfo[]; + + /** + * Creates a new SuggestionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionInfo instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.ISuggestionInfo): google.cloud.dataqna.v1alpha.SuggestionInfo; + + /** + * Encodes the specified SuggestionInfo message. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestionInfo.verify|verify} messages. + * @param message SuggestionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.ISuggestionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionInfo message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestionInfo.verify|verify} messages. + * @param message SuggestionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.ISuggestionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.SuggestionInfo; + + /** + * Decodes a SuggestionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.SuggestionInfo; + + /** + * Verifies a SuggestionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.SuggestionInfo; + + /** + * Creates a plain object from a SuggestionInfo message. Also converts values to other types if specified. + * @param message SuggestionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.SuggestionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SuggestionInfo { + + /** Properties of a MatchInfo. */ + interface IMatchInfo { + + /** MatchInfo startCharIndex */ + startCharIndex?: (number|null); + + /** MatchInfo length */ + length?: (number|null); + } + + /** Represents a MatchInfo. */ + class MatchInfo implements IMatchInfo { + + /** + * Constructs a new MatchInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.SuggestionInfo.IMatchInfo); + + /** MatchInfo startCharIndex. */ + public startCharIndex: number; + + /** MatchInfo length. */ + public length: number; + + /** + * Creates a new MatchInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns MatchInfo instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.SuggestionInfo.IMatchInfo): google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo; + + /** + * Encodes the specified MatchInfo message. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo.verify|verify} messages. + * @param message MatchInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.SuggestionInfo.IMatchInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MatchInfo message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo.verify|verify} messages. + * @param message MatchInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.SuggestionInfo.IMatchInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MatchInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MatchInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo; + + /** + * Decodes a MatchInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MatchInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo; + + /** + * Verifies a MatchInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MatchInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MatchInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo; + + /** + * Creates a plain object from a MatchInfo message. Also converts values to other types if specified. + * @param message MatchInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MatchInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SuggestQueriesResponse. */ + interface ISuggestQueriesResponse { + + /** SuggestQueriesResponse suggestions */ + suggestions?: (google.cloud.dataqna.v1alpha.ISuggestion[]|null); + } + + /** Represents a SuggestQueriesResponse. */ + class SuggestQueriesResponse implements ISuggestQueriesResponse { + + /** + * Constructs a new SuggestQueriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.ISuggestQueriesResponse); + + /** SuggestQueriesResponse suggestions. */ + public suggestions: google.cloud.dataqna.v1alpha.ISuggestion[]; + + /** + * Creates a new SuggestQueriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestQueriesResponse instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.ISuggestQueriesResponse): google.cloud.dataqna.v1alpha.SuggestQueriesResponse; + + /** + * Encodes the specified SuggestQueriesResponse message. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestQueriesResponse.verify|verify} messages. + * @param message SuggestQueriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestQueriesResponse message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestQueriesResponse.verify|verify} messages. + * @param message SuggestQueriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestQueriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.SuggestQueriesResponse; + + /** + * Decodes a SuggestQueriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.SuggestQueriesResponse; + + /** + * Verifies a SuggestQueriesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestQueriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestQueriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.SuggestQueriesResponse; + + /** + * Creates a plain object from a SuggestQueriesResponse message. Also converts values to other types if specified. + * @param message SuggestQueriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.SuggestQueriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestQueriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** SuggestionType enum. */ + enum SuggestionType { + SUGGESTION_TYPE_UNSPECIFIED = 0, + ENTITY = 1, + TEMPLATE = 2 + } + + /** Properties of a Question. */ + interface IQuestion { + + /** Question name */ + name?: (string|null); + + /** Question scopes */ + scopes?: (string[]|null); + + /** Question query */ + query?: (string|null); + + /** Question dataSourceAnnotations */ + dataSourceAnnotations?: (string[]|null); + + /** Question interpretError */ + interpretError?: (google.cloud.dataqna.v1alpha.IInterpretError|null); + + /** Question interpretations */ + interpretations?: (google.cloud.dataqna.v1alpha.IInterpretation[]|null); + + /** Question createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Question userEmail */ + userEmail?: (string|null); + + /** Question debugFlags */ + debugFlags?: (google.cloud.dataqna.v1alpha.IDebugFlags|null); + + /** Question debugInfo */ + debugInfo?: (google.protobuf.IAny|null); + } + + /** Represents a Question. */ + class Question implements IQuestion { + + /** + * Constructs a new Question. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IQuestion); + + /** Question name. */ + public name: string; + + /** Question scopes. */ + public scopes: string[]; + + /** Question query. */ + public query: string; + + /** Question dataSourceAnnotations. */ + public dataSourceAnnotations: string[]; + + /** Question interpretError. */ + public interpretError?: (google.cloud.dataqna.v1alpha.IInterpretError|null); + + /** Question interpretations. */ + public interpretations: google.cloud.dataqna.v1alpha.IInterpretation[]; + + /** Question createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Question userEmail. */ + public userEmail: string; + + /** Question debugFlags. */ + public debugFlags?: (google.cloud.dataqna.v1alpha.IDebugFlags|null); + + /** Question debugInfo. */ + public debugInfo?: (google.protobuf.IAny|null); + + /** + * Creates a new Question instance using the specified properties. + * @param [properties] Properties to set + * @returns Question instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IQuestion): google.cloud.dataqna.v1alpha.Question; + + /** + * Encodes the specified Question message. Does not implicitly {@link google.cloud.dataqna.v1alpha.Question.verify|verify} messages. + * @param message Question message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IQuestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Question message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.Question.verify|verify} messages. + * @param message Question message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IQuestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Question message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Question + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.Question; + + /** + * Decodes a Question message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Question + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.Question; + + /** + * Verifies a Question message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Question message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Question + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.Question; + + /** + * Creates a plain object from a Question message. Also converts values to other types if specified. + * @param message Question + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.Question, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Question to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterpretError. */ + interface IInterpretError { + + /** InterpretError message */ + message?: (string|null); + + /** InterpretError code */ + code?: (google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorCode|keyof typeof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorCode|null); + + /** InterpretError details */ + details?: (google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails|null); + } + + /** Represents an InterpretError. */ + class InterpretError implements IInterpretError { + + /** + * Constructs a new InterpretError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IInterpretError); + + /** InterpretError message. */ + public message: string; + + /** InterpretError code. */ + public code: (google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorCode|keyof typeof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorCode); + + /** InterpretError details. */ + public details?: (google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails|null); + + /** + * Creates a new InterpretError instance using the specified properties. + * @param [properties] Properties to set + * @returns InterpretError instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IInterpretError): google.cloud.dataqna.v1alpha.InterpretError; + + /** + * Encodes the specified InterpretError message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.verify|verify} messages. + * @param message InterpretError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IInterpretError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterpretError message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.verify|verify} messages. + * @param message InterpretError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IInterpretError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterpretError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterpretError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.InterpretError; + + /** + * Decodes an InterpretError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterpretError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.InterpretError; + + /** + * Verifies an InterpretError message. + * @param message Plain 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 InterpretError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterpretError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.InterpretError; + + /** + * Creates a plain object from an InterpretError message. Also converts values to other types if specified. + * @param message InterpretError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.InterpretError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterpretError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InterpretError { + + /** Properties of an InterpretErrorDetails. */ + interface IInterpretErrorDetails { + + /** InterpretErrorDetails unsupportedDetails */ + unsupportedDetails?: (google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails|null); + + /** InterpretErrorDetails incompleteQueryDetails */ + incompleteQueryDetails?: (google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails|null); + + /** InterpretErrorDetails ambiguityDetails */ + ambiguityDetails?: (google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails|null); + } + + /** Represents an InterpretErrorDetails. */ + class InterpretErrorDetails implements IInterpretErrorDetails { + + /** + * Constructs a new InterpretErrorDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails); + + /** InterpretErrorDetails unsupportedDetails. */ + public unsupportedDetails?: (google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails|null); + + /** InterpretErrorDetails incompleteQueryDetails. */ + public incompleteQueryDetails?: (google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails|null); + + /** InterpretErrorDetails ambiguityDetails. */ + public ambiguityDetails?: (google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails|null); + + /** + * Creates a new InterpretErrorDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns InterpretErrorDetails instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails): google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails; + + /** + * Encodes the specified InterpretErrorDetails message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.verify|verify} messages. + * @param message InterpretErrorDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterpretErrorDetails message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.verify|verify} messages. + * @param message InterpretErrorDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterpretErrorDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterpretErrorDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails; + + /** + * Decodes an InterpretErrorDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterpretErrorDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails; + + /** + * Verifies an InterpretErrorDetails message. + * @param message Plain 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 InterpretErrorDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterpretErrorDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails; + + /** + * Creates a plain object from an InterpretErrorDetails message. Also converts values to other types if specified. + * @param message InterpretErrorDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterpretErrorDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterpretUnsupportedDetails. */ + interface IInterpretUnsupportedDetails { + + /** InterpretUnsupportedDetails operators */ + operators?: (string[]|null); + + /** InterpretUnsupportedDetails intent */ + intent?: (string[]|null); + } + + /** Represents an InterpretUnsupportedDetails. */ + class InterpretUnsupportedDetails implements IInterpretUnsupportedDetails { + + /** + * Constructs a new InterpretUnsupportedDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails); + + /** InterpretUnsupportedDetails operators. */ + public operators: string[]; + + /** InterpretUnsupportedDetails intent. */ + public intent: string[]; + + /** + * Creates a new InterpretUnsupportedDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns InterpretUnsupportedDetails instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails): google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails; + + /** + * Encodes the specified InterpretUnsupportedDetails message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.verify|verify} messages. + * @param message InterpretUnsupportedDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterpretUnsupportedDetails message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.verify|verify} messages. + * @param message InterpretUnsupportedDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterpretUnsupportedDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterpretUnsupportedDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails; + + /** + * Decodes an InterpretUnsupportedDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterpretUnsupportedDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails; + + /** + * Verifies an InterpretUnsupportedDetails message. + * @param message Plain 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 InterpretUnsupportedDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterpretUnsupportedDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails; + + /** + * Creates a plain object from an InterpretUnsupportedDetails message. Also converts values to other types if specified. + * @param message InterpretUnsupportedDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterpretUnsupportedDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterpretIncompleteQueryDetails. */ + interface IInterpretIncompleteQueryDetails { + + /** InterpretIncompleteQueryDetails entities */ + entities?: (google.cloud.dataqna.v1alpha.InterpretEntity[]|null); + } + + /** Represents an InterpretIncompleteQueryDetails. */ + class InterpretIncompleteQueryDetails implements IInterpretIncompleteQueryDetails { + + /** + * Constructs a new InterpretIncompleteQueryDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails); + + /** InterpretIncompleteQueryDetails entities. */ + public entities: google.cloud.dataqna.v1alpha.InterpretEntity[]; + + /** + * Creates a new InterpretIncompleteQueryDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns InterpretIncompleteQueryDetails instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails): google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails; + + /** + * Encodes the specified InterpretIncompleteQueryDetails message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.verify|verify} messages. + * @param message InterpretIncompleteQueryDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterpretIncompleteQueryDetails message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.verify|verify} messages. + * @param message InterpretIncompleteQueryDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterpretIncompleteQueryDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterpretIncompleteQueryDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails; + + /** + * Decodes an InterpretIncompleteQueryDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterpretIncompleteQueryDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails; + + /** + * Verifies an InterpretIncompleteQueryDetails message. + * @param message Plain 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 InterpretIncompleteQueryDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterpretIncompleteQueryDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails; + + /** + * Creates a plain object from an InterpretIncompleteQueryDetails message. Also converts values to other types if specified. + * @param message InterpretIncompleteQueryDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterpretIncompleteQueryDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterpretAmbiguityDetails. */ + interface IInterpretAmbiguityDetails { + } + + /** Represents an InterpretAmbiguityDetails. */ + class InterpretAmbiguityDetails implements IInterpretAmbiguityDetails { + + /** + * Constructs a new InterpretAmbiguityDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails); + + /** + * Creates a new InterpretAmbiguityDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns InterpretAmbiguityDetails instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails): google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails; + + /** + * Encodes the specified InterpretAmbiguityDetails message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails.verify|verify} messages. + * @param message InterpretAmbiguityDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterpretAmbiguityDetails message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails.verify|verify} messages. + * @param message InterpretAmbiguityDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterpretAmbiguityDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterpretAmbiguityDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails; + + /** + * Decodes an InterpretAmbiguityDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterpretAmbiguityDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails; + + /** + * Verifies an InterpretAmbiguityDetails message. + * @param message Plain 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 InterpretAmbiguityDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterpretAmbiguityDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails; + + /** + * Creates a plain object from an InterpretAmbiguityDetails message. Also converts values to other types if specified. + * @param message InterpretAmbiguityDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterpretAmbiguityDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** InterpretErrorCode enum. */ + enum InterpretErrorCode { + INTERPRET_ERROR_CODE_UNSPECIFIED = 0, + INVALID_QUERY = 1, + FAILED_TO_UNDERSTAND = 2, + FAILED_TO_ANSWER = 3 + } + } + + /** Properties of an ExecutionInfo. */ + interface IExecutionInfo { + + /** ExecutionInfo jobCreationStatus */ + jobCreationStatus?: (google.rpc.IStatus|null); + + /** ExecutionInfo jobExecutionState */ + jobExecutionState?: (google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState|keyof typeof google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState|null); + + /** ExecutionInfo createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ExecutionInfo bigqueryJob */ + bigqueryJob?: (google.cloud.dataqna.v1alpha.IBigQueryJob|null); + } + + /** Represents an ExecutionInfo. */ + class ExecutionInfo implements IExecutionInfo { + + /** + * Constructs a new ExecutionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IExecutionInfo); + + /** ExecutionInfo jobCreationStatus. */ + public jobCreationStatus?: (google.rpc.IStatus|null); + + /** ExecutionInfo jobExecutionState. */ + public jobExecutionState: (google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState|keyof typeof google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState); + + /** ExecutionInfo createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ExecutionInfo bigqueryJob. */ + public bigqueryJob?: (google.cloud.dataqna.v1alpha.IBigQueryJob|null); + + /** + * Creates a new ExecutionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutionInfo instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IExecutionInfo): google.cloud.dataqna.v1alpha.ExecutionInfo; + + /** + * Encodes the specified ExecutionInfo message. Does not implicitly {@link google.cloud.dataqna.v1alpha.ExecutionInfo.verify|verify} messages. + * @param message ExecutionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IExecutionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutionInfo message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.ExecutionInfo.verify|verify} messages. + * @param message ExecutionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IExecutionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.ExecutionInfo; + + /** + * Decodes an ExecutionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.ExecutionInfo; + + /** + * Verifies an ExecutionInfo message. + * @param message Plain 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 ExecutionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.ExecutionInfo; + + /** + * Creates a plain object from an ExecutionInfo message. Also converts values to other types if specified. + * @param message ExecutionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.ExecutionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ExecutionInfo { + + /** JobExecutionState enum. */ + enum JobExecutionState { + JOB_EXECUTION_STATE_UNSPECIFIED = 0, + NOT_EXECUTED = 1, + RUNNING = 2, + SUCCEEDED = 3, + FAILED = 4 + } + } + + /** Properties of a BigQueryJob. */ + interface IBigQueryJob { + + /** BigQueryJob jobId */ + jobId?: (string|null); + + /** BigQueryJob projectId */ + projectId?: (string|null); + + /** BigQueryJob location */ + location?: (string|null); + } + + /** Represents a BigQueryJob. */ + class BigQueryJob implements IBigQueryJob { + + /** + * Constructs a new BigQueryJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IBigQueryJob); + + /** BigQueryJob jobId. */ + public jobId: string; + + /** BigQueryJob projectId. */ + public projectId: string; + + /** BigQueryJob location. */ + public location: string; + + /** + * Creates a new BigQueryJob instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryJob instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IBigQueryJob): google.cloud.dataqna.v1alpha.BigQueryJob; + + /** + * Encodes the specified BigQueryJob message. Does not implicitly {@link google.cloud.dataqna.v1alpha.BigQueryJob.verify|verify} messages. + * @param message BigQueryJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IBigQueryJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryJob message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.BigQueryJob.verify|verify} messages. + * @param message BigQueryJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IBigQueryJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.BigQueryJob; + + /** + * Decodes a BigQueryJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.BigQueryJob; + + /** + * Verifies a BigQueryJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.BigQueryJob; + + /** + * Creates a plain object from a BigQueryJob message. Also converts values to other types if specified. + * @param message BigQueryJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.BigQueryJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Interpretation. */ + interface IInterpretation { + + /** Interpretation dataSources */ + dataSources?: (string[]|null); + + /** Interpretation confidence */ + confidence?: (number|null); + + /** Interpretation unusedPhrases */ + unusedPhrases?: (string[]|null); + + /** Interpretation humanReadable */ + humanReadable?: (google.cloud.dataqna.v1alpha.IHumanReadable|null); + + /** Interpretation interpretationStructure */ + interpretationStructure?: (google.cloud.dataqna.v1alpha.IInterpretationStructure|null); + + /** Interpretation dataQuery */ + dataQuery?: (google.cloud.dataqna.v1alpha.IDataQuery|null); + + /** Interpretation executionInfo */ + executionInfo?: (google.cloud.dataqna.v1alpha.IExecutionInfo|null); + } + + /** Represents an Interpretation. */ + class Interpretation implements IInterpretation { + + /** + * Constructs a new Interpretation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IInterpretation); + + /** Interpretation dataSources. */ + public dataSources: string[]; + + /** Interpretation confidence. */ + public confidence: number; + + /** Interpretation unusedPhrases. */ + public unusedPhrases: string[]; + + /** Interpretation humanReadable. */ + public humanReadable?: (google.cloud.dataqna.v1alpha.IHumanReadable|null); + + /** Interpretation interpretationStructure. */ + public interpretationStructure?: (google.cloud.dataqna.v1alpha.IInterpretationStructure|null); + + /** Interpretation dataQuery. */ + public dataQuery?: (google.cloud.dataqna.v1alpha.IDataQuery|null); + + /** Interpretation executionInfo. */ + public executionInfo?: (google.cloud.dataqna.v1alpha.IExecutionInfo|null); + + /** + * Creates a new Interpretation instance using the specified properties. + * @param [properties] Properties to set + * @returns Interpretation instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IInterpretation): google.cloud.dataqna.v1alpha.Interpretation; + + /** + * Encodes the specified Interpretation message. Does not implicitly {@link google.cloud.dataqna.v1alpha.Interpretation.verify|verify} messages. + * @param message Interpretation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IInterpretation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interpretation message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.Interpretation.verify|verify} messages. + * @param message Interpretation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IInterpretation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interpretation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interpretation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.Interpretation; + + /** + * Decodes an Interpretation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interpretation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.Interpretation; + + /** + * Verifies an Interpretation message. + * @param message Plain 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 Interpretation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interpretation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.Interpretation; + + /** + * Creates a plain object from an Interpretation message. Also converts values to other types if specified. + * @param message Interpretation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.Interpretation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interpretation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DataQuery. */ + interface IDataQuery { + + /** DataQuery sql */ + sql?: (string|null); + } + + /** Represents a DataQuery. */ + class DataQuery implements IDataQuery { + + /** + * Constructs a new DataQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IDataQuery); + + /** DataQuery sql. */ + public sql: string; + + /** + * Creates a new DataQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns DataQuery instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IDataQuery): google.cloud.dataqna.v1alpha.DataQuery; + + /** + * Encodes the specified DataQuery message. Does not implicitly {@link google.cloud.dataqna.v1alpha.DataQuery.verify|verify} messages. + * @param message DataQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IDataQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataQuery message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.DataQuery.verify|verify} messages. + * @param message DataQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IDataQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.DataQuery; + + /** + * Decodes a DataQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.DataQuery; + + /** + * Verifies a DataQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.DataQuery; + + /** + * Creates a plain object from a DataQuery message. Also converts values to other types if specified. + * @param message DataQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.DataQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HumanReadable. */ + interface IHumanReadable { + + /** HumanReadable generatedInterpretation */ + generatedInterpretation?: (google.cloud.dataqna.v1alpha.IAnnotatedString|null); + + /** HumanReadable originalQuestion */ + originalQuestion?: (google.cloud.dataqna.v1alpha.IAnnotatedString|null); + } + + /** Represents a HumanReadable. */ + class HumanReadable implements IHumanReadable { + + /** + * Constructs a new HumanReadable. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IHumanReadable); + + /** HumanReadable generatedInterpretation. */ + public generatedInterpretation?: (google.cloud.dataqna.v1alpha.IAnnotatedString|null); + + /** HumanReadable originalQuestion. */ + public originalQuestion?: (google.cloud.dataqna.v1alpha.IAnnotatedString|null); + + /** + * Creates a new HumanReadable instance using the specified properties. + * @param [properties] Properties to set + * @returns HumanReadable instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IHumanReadable): google.cloud.dataqna.v1alpha.HumanReadable; + + /** + * Encodes the specified HumanReadable message. Does not implicitly {@link google.cloud.dataqna.v1alpha.HumanReadable.verify|verify} messages. + * @param message HumanReadable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IHumanReadable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HumanReadable message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.HumanReadable.verify|verify} messages. + * @param message HumanReadable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IHumanReadable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HumanReadable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HumanReadable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.HumanReadable; + + /** + * Decodes a HumanReadable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HumanReadable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.HumanReadable; + + /** + * Verifies a HumanReadable message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HumanReadable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HumanReadable + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.HumanReadable; + + /** + * Creates a plain object from a HumanReadable message. Also converts values to other types if specified. + * @param message HumanReadable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.HumanReadable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HumanReadable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterpretationStructure. */ + interface IInterpretationStructure { + + /** InterpretationStructure visualizationTypes */ + visualizationTypes?: (google.cloud.dataqna.v1alpha.InterpretationStructure.VisualizationType[]|null); + + /** InterpretationStructure columnInfo */ + columnInfo?: (google.cloud.dataqna.v1alpha.InterpretationStructure.IColumnInfo[]|null); + } + + /** Represents an InterpretationStructure. */ + class InterpretationStructure implements IInterpretationStructure { + + /** + * Constructs a new InterpretationStructure. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IInterpretationStructure); + + /** InterpretationStructure visualizationTypes. */ + public visualizationTypes: google.cloud.dataqna.v1alpha.InterpretationStructure.VisualizationType[]; + + /** InterpretationStructure columnInfo. */ + public columnInfo: google.cloud.dataqna.v1alpha.InterpretationStructure.IColumnInfo[]; + + /** + * Creates a new InterpretationStructure instance using the specified properties. + * @param [properties] Properties to set + * @returns InterpretationStructure instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IInterpretationStructure): google.cloud.dataqna.v1alpha.InterpretationStructure; + + /** + * Encodes the specified InterpretationStructure message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretationStructure.verify|verify} messages. + * @param message InterpretationStructure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IInterpretationStructure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterpretationStructure message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretationStructure.verify|verify} messages. + * @param message InterpretationStructure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IInterpretationStructure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterpretationStructure message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterpretationStructure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.InterpretationStructure; + + /** + * Decodes an InterpretationStructure message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterpretationStructure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.InterpretationStructure; + + /** + * Verifies an InterpretationStructure message. + * @param message Plain 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 InterpretationStructure message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterpretationStructure + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.InterpretationStructure; + + /** + * Creates a plain object from an InterpretationStructure message. Also converts values to other types if specified. + * @param message InterpretationStructure + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.InterpretationStructure, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterpretationStructure to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InterpretationStructure { + + /** Properties of a ColumnInfo. */ + interface IColumnInfo { + + /** ColumnInfo outputAlias */ + outputAlias?: (string|null); + + /** ColumnInfo displayName */ + displayName?: (string|null); + } + + /** Represents a ColumnInfo. */ + class ColumnInfo implements IColumnInfo { + + /** + * Constructs a new ColumnInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.InterpretationStructure.IColumnInfo); + + /** ColumnInfo outputAlias. */ + public outputAlias: string; + + /** ColumnInfo displayName. */ + public displayName: string; + + /** + * Creates a new ColumnInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnInfo instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.InterpretationStructure.IColumnInfo): google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo; + + /** + * Encodes the specified ColumnInfo message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo.verify|verify} messages. + * @param message ColumnInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.InterpretationStructure.IColumnInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnInfo message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo.verify|verify} messages. + * @param message ColumnInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.InterpretationStructure.IColumnInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo; + + /** + * Decodes a ColumnInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo; + + /** + * Verifies a ColumnInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo; + + /** + * Creates a plain object from a ColumnInfo message. Also converts values to other types if specified. + * @param message ColumnInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** VisualizationType enum. */ + enum VisualizationType { + VISUALIZATION_TYPE_UNSPECIFIED = 0, + TABLE = 1, + BAR_CHART = 2, + COLUMN_CHART = 3, + TIMELINE = 4, + SCATTER_PLOT = 5, + PIE_CHART = 6, + LINE_CHART = 7, + AREA_CHART = 8, + COMBO_CHART = 9, + HISTOGRAM = 10, + GENERIC_CHART = 11, + CHART_NOT_UNDERSTOOD = 12 + } + } + + /** Properties of a DebugFlags. */ + interface IDebugFlags { + + /** DebugFlags includeVaQuery */ + includeVaQuery?: (boolean|null); + + /** DebugFlags includeNestedVaQuery */ + includeNestedVaQuery?: (boolean|null); + + /** DebugFlags includeHumanInterpretation */ + includeHumanInterpretation?: (boolean|null); + + /** DebugFlags includeAquaDebugResponse */ + includeAquaDebugResponse?: (boolean|null); + + /** DebugFlags timeOverride */ + timeOverride?: (number|Long|string|null); + + /** DebugFlags isInternalGoogleUser */ + isInternalGoogleUser?: (boolean|null); + + /** DebugFlags ignoreCache */ + ignoreCache?: (boolean|null); + + /** DebugFlags includeSearchEntitiesRpc */ + includeSearchEntitiesRpc?: (boolean|null); + + /** DebugFlags includeListColumnAnnotationsRpc */ + includeListColumnAnnotationsRpc?: (boolean|null); + + /** DebugFlags includeVirtualAnalystEntities */ + includeVirtualAnalystEntities?: (boolean|null); + + /** DebugFlags includeTableList */ + includeTableList?: (boolean|null); + + /** DebugFlags includeDomainList */ + includeDomainList?: (boolean|null); + } + + /** Represents a DebugFlags. */ + class DebugFlags implements IDebugFlags { + + /** + * Constructs a new DebugFlags. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IDebugFlags); + + /** DebugFlags includeVaQuery. */ + public includeVaQuery: boolean; + + /** DebugFlags includeNestedVaQuery. */ + public includeNestedVaQuery: boolean; + + /** DebugFlags includeHumanInterpretation. */ + public includeHumanInterpretation: boolean; + + /** DebugFlags includeAquaDebugResponse. */ + public includeAquaDebugResponse: boolean; + + /** DebugFlags timeOverride. */ + public timeOverride: (number|Long|string); + + /** DebugFlags isInternalGoogleUser. */ + public isInternalGoogleUser: boolean; + + /** DebugFlags ignoreCache. */ + public ignoreCache: boolean; + + /** DebugFlags includeSearchEntitiesRpc. */ + public includeSearchEntitiesRpc: boolean; + + /** DebugFlags includeListColumnAnnotationsRpc. */ + public includeListColumnAnnotationsRpc: boolean; + + /** DebugFlags includeVirtualAnalystEntities. */ + public includeVirtualAnalystEntities: boolean; + + /** DebugFlags includeTableList. */ + public includeTableList: boolean; + + /** DebugFlags includeDomainList. */ + public includeDomainList: boolean; + + /** + * Creates a new DebugFlags instance using the specified properties. + * @param [properties] Properties to set + * @returns DebugFlags instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IDebugFlags): google.cloud.dataqna.v1alpha.DebugFlags; + + /** + * Encodes the specified DebugFlags message. Does not implicitly {@link google.cloud.dataqna.v1alpha.DebugFlags.verify|verify} messages. + * @param message DebugFlags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IDebugFlags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DebugFlags message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.DebugFlags.verify|verify} messages. + * @param message DebugFlags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IDebugFlags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DebugFlags message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DebugFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.DebugFlags; + + /** + * Decodes a DebugFlags message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DebugFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.DebugFlags; + + /** + * Verifies a DebugFlags message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DebugFlags message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DebugFlags + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.DebugFlags; + + /** + * Creates a plain object from a DebugFlags message. Also converts values to other types if specified. + * @param message DebugFlags + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.DebugFlags, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DebugFlags to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** InterpretEntity enum. */ + enum InterpretEntity { + INTERPRET_ENTITY_UNSPECIFIED = 0, + DIMENSION = 1, + METRIC = 2 + } + + /** Represents a QuestionService */ + class QuestionService extends $protobuf.rpc.Service { + + /** + * Constructs a new QuestionService 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 QuestionService 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): QuestionService; + + /** + * Calls GetQuestion. + * @param request GetQuestionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Question + */ + public getQuestion(request: google.cloud.dataqna.v1alpha.IGetQuestionRequest, callback: google.cloud.dataqna.v1alpha.QuestionService.GetQuestionCallback): void; + + /** + * Calls GetQuestion. + * @param request GetQuestionRequest message or plain object + * @returns Promise + */ + public getQuestion(request: google.cloud.dataqna.v1alpha.IGetQuestionRequest): Promise; + + /** + * Calls CreateQuestion. + * @param request CreateQuestionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Question + */ + public createQuestion(request: google.cloud.dataqna.v1alpha.ICreateQuestionRequest, callback: google.cloud.dataqna.v1alpha.QuestionService.CreateQuestionCallback): void; + + /** + * Calls CreateQuestion. + * @param request CreateQuestionRequest message or plain object + * @returns Promise + */ + public createQuestion(request: google.cloud.dataqna.v1alpha.ICreateQuestionRequest): Promise; + + /** + * Calls ExecuteQuestion. + * @param request ExecuteQuestionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Question + */ + public executeQuestion(request: google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, callback: google.cloud.dataqna.v1alpha.QuestionService.ExecuteQuestionCallback): void; + + /** + * Calls ExecuteQuestion. + * @param request ExecuteQuestionRequest message or plain object + * @returns Promise + */ + public executeQuestion(request: google.cloud.dataqna.v1alpha.IExecuteQuestionRequest): Promise; + + /** + * Calls GetUserFeedback. + * @param request GetUserFeedbackRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserFeedback + */ + public getUserFeedback(request: google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, callback: google.cloud.dataqna.v1alpha.QuestionService.GetUserFeedbackCallback): void; + + /** + * Calls GetUserFeedback. + * @param request GetUserFeedbackRequest message or plain object + * @returns Promise + */ + public getUserFeedback(request: google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest): Promise; + + /** + * Calls UpdateUserFeedback. + * @param request UpdateUserFeedbackRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserFeedback + */ + public updateUserFeedback(request: google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, callback: google.cloud.dataqna.v1alpha.QuestionService.UpdateUserFeedbackCallback): void; + + /** + * Calls UpdateUserFeedback. + * @param request UpdateUserFeedbackRequest message or plain object + * @returns Promise + */ + public updateUserFeedback(request: google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest): Promise; + } + + namespace QuestionService { + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#getQuestion}. + * @param error Error, if any + * @param [response] Question + */ + type GetQuestionCallback = (error: (Error|null), response?: google.cloud.dataqna.v1alpha.Question) => void; + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#createQuestion}. + * @param error Error, if any + * @param [response] Question + */ + type CreateQuestionCallback = (error: (Error|null), response?: google.cloud.dataqna.v1alpha.Question) => void; + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#executeQuestion}. + * @param error Error, if any + * @param [response] Question + */ + type ExecuteQuestionCallback = (error: (Error|null), response?: google.cloud.dataqna.v1alpha.Question) => void; + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#getUserFeedback}. + * @param error Error, if any + * @param [response] UserFeedback + */ + type GetUserFeedbackCallback = (error: (Error|null), response?: google.cloud.dataqna.v1alpha.UserFeedback) => void; + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#updateUserFeedback}. + * @param error Error, if any + * @param [response] UserFeedback + */ + type UpdateUserFeedbackCallback = (error: (Error|null), response?: google.cloud.dataqna.v1alpha.UserFeedback) => void; + } + + /** Properties of a GetQuestionRequest. */ + interface IGetQuestionRequest { + + /** GetQuestionRequest name */ + name?: (string|null); + + /** GetQuestionRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a GetQuestionRequest. */ + class GetQuestionRequest implements IGetQuestionRequest { + + /** + * Constructs a new GetQuestionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IGetQuestionRequest); + + /** GetQuestionRequest name. */ + public name: string; + + /** GetQuestionRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new GetQuestionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetQuestionRequest instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IGetQuestionRequest): google.cloud.dataqna.v1alpha.GetQuestionRequest; + + /** + * Encodes the specified GetQuestionRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.GetQuestionRequest.verify|verify} messages. + * @param message GetQuestionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IGetQuestionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetQuestionRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.GetQuestionRequest.verify|verify} messages. + * @param message GetQuestionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IGetQuestionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetQuestionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.GetQuestionRequest; + + /** + * Decodes a GetQuestionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.GetQuestionRequest; + + /** + * Verifies a GetQuestionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetQuestionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetQuestionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.GetQuestionRequest; + + /** + * Creates a plain object from a GetQuestionRequest message. Also converts values to other types if specified. + * @param message GetQuestionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.GetQuestionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetQuestionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateQuestionRequest. */ + interface ICreateQuestionRequest { + + /** CreateQuestionRequest parent */ + parent?: (string|null); + + /** CreateQuestionRequest question */ + question?: (google.cloud.dataqna.v1alpha.IQuestion|null); + } + + /** Represents a CreateQuestionRequest. */ + class CreateQuestionRequest implements ICreateQuestionRequest { + + /** + * Constructs a new CreateQuestionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.ICreateQuestionRequest); + + /** CreateQuestionRequest parent. */ + public parent: string; + + /** CreateQuestionRequest question. */ + public question?: (google.cloud.dataqna.v1alpha.IQuestion|null); + + /** + * Creates a new CreateQuestionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateQuestionRequest instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.ICreateQuestionRequest): google.cloud.dataqna.v1alpha.CreateQuestionRequest; + + /** + * Encodes the specified CreateQuestionRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.CreateQuestionRequest.verify|verify} messages. + * @param message CreateQuestionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.ICreateQuestionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateQuestionRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.CreateQuestionRequest.verify|verify} messages. + * @param message CreateQuestionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.ICreateQuestionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateQuestionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.CreateQuestionRequest; + + /** + * Decodes a CreateQuestionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.CreateQuestionRequest; + + /** + * Verifies a CreateQuestionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateQuestionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateQuestionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.CreateQuestionRequest; + + /** + * Creates a plain object from a CreateQuestionRequest message. Also converts values to other types if specified. + * @param message CreateQuestionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.CreateQuestionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateQuestionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExecuteQuestionRequest. */ + interface IExecuteQuestionRequest { + + /** ExecuteQuestionRequest name */ + name?: (string|null); + + /** ExecuteQuestionRequest interpretationIndex */ + interpretationIndex?: (number|null); + } + + /** Represents an ExecuteQuestionRequest. */ + class ExecuteQuestionRequest implements IExecuteQuestionRequest { + + /** + * Constructs a new ExecuteQuestionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IExecuteQuestionRequest); + + /** ExecuteQuestionRequest name. */ + public name: string; + + /** ExecuteQuestionRequest interpretationIndex. */ + public interpretationIndex: number; + + /** + * Creates a new ExecuteQuestionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteQuestionRequest instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IExecuteQuestionRequest): google.cloud.dataqna.v1alpha.ExecuteQuestionRequest; + + /** + * Encodes the specified ExecuteQuestionRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.ExecuteQuestionRequest.verify|verify} messages. + * @param message ExecuteQuestionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteQuestionRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.ExecuteQuestionRequest.verify|verify} messages. + * @param message ExecuteQuestionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteQuestionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.ExecuteQuestionRequest; + + /** + * Decodes an ExecuteQuestionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.ExecuteQuestionRequest; + + /** + * Verifies an ExecuteQuestionRequest message. + * @param message Plain 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 ExecuteQuestionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteQuestionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.ExecuteQuestionRequest; + + /** + * Creates a plain object from an ExecuteQuestionRequest message. Also converts values to other types if specified. + * @param message ExecuteQuestionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.ExecuteQuestionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteQuestionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetUserFeedbackRequest. */ + interface IGetUserFeedbackRequest { + + /** GetUserFeedbackRequest name */ + name?: (string|null); + } + + /** Represents a GetUserFeedbackRequest. */ + class GetUserFeedbackRequest implements IGetUserFeedbackRequest { + + /** + * Constructs a new GetUserFeedbackRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest); + + /** GetUserFeedbackRequest name. */ + public name: string; + + /** + * Creates a new GetUserFeedbackRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUserFeedbackRequest instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest): google.cloud.dataqna.v1alpha.GetUserFeedbackRequest; + + /** + * Encodes the specified GetUserFeedbackRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.GetUserFeedbackRequest.verify|verify} messages. + * @param message GetUserFeedbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetUserFeedbackRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.GetUserFeedbackRequest.verify|verify} messages. + * @param message GetUserFeedbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetUserFeedbackRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUserFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.GetUserFeedbackRequest; + + /** + * Decodes a GetUserFeedbackRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUserFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.GetUserFeedbackRequest; + + /** + * Verifies a GetUserFeedbackRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetUserFeedbackRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUserFeedbackRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.GetUserFeedbackRequest; + + /** + * Creates a plain object from a GetUserFeedbackRequest message. Also converts values to other types if specified. + * @param message GetUserFeedbackRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.GetUserFeedbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetUserFeedbackRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateUserFeedbackRequest. */ + interface IUpdateUserFeedbackRequest { + + /** UpdateUserFeedbackRequest userFeedback */ + userFeedback?: (google.cloud.dataqna.v1alpha.IUserFeedback|null); + + /** UpdateUserFeedbackRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateUserFeedbackRequest. */ + class UpdateUserFeedbackRequest implements IUpdateUserFeedbackRequest { + + /** + * Constructs a new UpdateUserFeedbackRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest); + + /** UpdateUserFeedbackRequest userFeedback. */ + public userFeedback?: (google.cloud.dataqna.v1alpha.IUserFeedback|null); + + /** UpdateUserFeedbackRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateUserFeedbackRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateUserFeedbackRequest instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest): google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest; + + /** + * Encodes the specified UpdateUserFeedbackRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest.verify|verify} messages. + * @param message UpdateUserFeedbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateUserFeedbackRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest.verify|verify} messages. + * @param message UpdateUserFeedbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateUserFeedbackRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateUserFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest; + + /** + * Decodes an UpdateUserFeedbackRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateUserFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest; + + /** + * Verifies an UpdateUserFeedbackRequest message. + * @param message Plain 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 UpdateUserFeedbackRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateUserFeedbackRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest; + + /** + * Creates a plain object from an UpdateUserFeedbackRequest message. Also converts values to other types if specified. + * @param message UpdateUserFeedbackRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateUserFeedbackRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UserFeedback. */ + interface IUserFeedback { + + /** UserFeedback name */ + name?: (string|null); + + /** UserFeedback freeFormFeedback */ + freeFormFeedback?: (string|null); + + /** UserFeedback rating */ + rating?: (google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating|keyof typeof google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating|null); + } + + /** Represents a UserFeedback. */ + class UserFeedback implements IUserFeedback { + + /** + * Constructs a new UserFeedback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataqna.v1alpha.IUserFeedback); + + /** UserFeedback name. */ + public name: string; + + /** UserFeedback freeFormFeedback. */ + public freeFormFeedback: string; + + /** UserFeedback rating. */ + public rating: (google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating|keyof typeof google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating); + + /** + * Creates a new UserFeedback instance using the specified properties. + * @param [properties] Properties to set + * @returns UserFeedback instance + */ + public static create(properties?: google.cloud.dataqna.v1alpha.IUserFeedback): google.cloud.dataqna.v1alpha.UserFeedback; + + /** + * Encodes the specified UserFeedback message. Does not implicitly {@link google.cloud.dataqna.v1alpha.UserFeedback.verify|verify} messages. + * @param message UserFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataqna.v1alpha.IUserFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserFeedback message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.UserFeedback.verify|verify} messages. + * @param message UserFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataqna.v1alpha.IUserFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserFeedback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataqna.v1alpha.UserFeedback; + + /** + * Decodes a UserFeedback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataqna.v1alpha.UserFeedback; + + /** + * Verifies a UserFeedback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserFeedback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserFeedback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataqna.v1alpha.UserFeedback; + + /** + * Creates a plain object from a UserFeedback message. Also converts values to other types if specified. + * @param message UserFeedback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataqna.v1alpha.UserFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserFeedback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UserFeedback { + + /** UserFeedbackRating enum. */ + enum UserFeedbackRating { + USER_FEEDBACK_RATING_UNSPECIFIED = 0, + POSITIVE = 1, + NEGATIVE = 2 + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get: string; + + /** HttpRule put. */ + public put: string; + + /** HttpRule post. */ + public post: string; + + /** HttpRule delete. */ + public delete: string; + + /** HttpRule patch. */ + public patch: string; + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of 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 }; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/packages/google-cloud-dataqna/protos/protos.js b/packages/google-cloud-dataqna/protos/protos.js new file mode 100644 index 00000000000..44b7dab3d46 --- /dev/null +++ b/packages/google-cloud-dataqna/protos/protos.js @@ -0,0 +1,18528 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_data_qna_protos || ($protobuf.roots._google_cloud_data_qna_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.dataqna = (function() { + + /** + * Namespace dataqna. + * @memberof google.cloud + * @namespace + */ + var dataqna = {}; + + dataqna.v1alpha = (function() { + + /** + * Namespace v1alpha. + * @memberof google.cloud.dataqna + * @namespace + */ + var v1alpha = {}; + + v1alpha.AnnotatedString = (function() { + + /** + * Properties of an AnnotatedString. + * @memberof google.cloud.dataqna.v1alpha + * @interface IAnnotatedString + * @property {string|null} [textFormatted] AnnotatedString textFormatted + * @property {string|null} [htmlFormatted] AnnotatedString htmlFormatted + * @property {Array.|null} [markups] AnnotatedString markups + */ + + /** + * Constructs a new AnnotatedString. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents an AnnotatedString. + * @implements IAnnotatedString + * @constructor + * @param {google.cloud.dataqna.v1alpha.IAnnotatedString=} [properties] Properties to set + */ + function AnnotatedString(properties) { + this.markups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotatedString textFormatted. + * @member {string} textFormatted + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @instance + */ + AnnotatedString.prototype.textFormatted = ""; + + /** + * AnnotatedString htmlFormatted. + * @member {string} htmlFormatted + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @instance + */ + AnnotatedString.prototype.htmlFormatted = ""; + + /** + * AnnotatedString markups. + * @member {Array.} markups + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @instance + */ + AnnotatedString.prototype.markups = $util.emptyArray; + + /** + * Creates a new AnnotatedString instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @static + * @param {google.cloud.dataqna.v1alpha.IAnnotatedString=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.AnnotatedString} AnnotatedString instance + */ + AnnotatedString.create = function create(properties) { + return new AnnotatedString(properties); + }; + + /** + * Encodes the specified AnnotatedString message. Does not implicitly {@link google.cloud.dataqna.v1alpha.AnnotatedString.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @static + * @param {google.cloud.dataqna.v1alpha.IAnnotatedString} message AnnotatedString message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedString.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textFormatted != null && Object.hasOwnProperty.call(message, "textFormatted")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textFormatted); + if (message.htmlFormatted != null && Object.hasOwnProperty.call(message, "htmlFormatted")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.htmlFormatted); + if (message.markups != null && message.markups.length) + for (var i = 0; i < message.markups.length; ++i) + $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup.encode(message.markups[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotatedString message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.AnnotatedString.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @static + * @param {google.cloud.dataqna.v1alpha.IAnnotatedString} message AnnotatedString message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedString.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotatedString message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.AnnotatedString} AnnotatedString + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedString.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.AnnotatedString(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.textFormatted = reader.string(); + break; + case 2: + message.htmlFormatted = reader.string(); + break; + case 3: + if (!(message.markups && message.markups.length)) + message.markups = []; + message.markups.push($root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotatedString message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.AnnotatedString} AnnotatedString + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedString.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotatedString message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotatedString.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textFormatted != null && message.hasOwnProperty("textFormatted")) + if (!$util.isString(message.textFormatted)) + return "textFormatted: string expected"; + if (message.htmlFormatted != null && message.hasOwnProperty("htmlFormatted")) + if (!$util.isString(message.htmlFormatted)) + return "htmlFormatted: string expected"; + if (message.markups != null && message.hasOwnProperty("markups")) { + if (!Array.isArray(message.markups)) + return "markups: array expected"; + for (var i = 0; i < message.markups.length; ++i) { + var error = $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup.verify(message.markups[i]); + if (error) + return "markups." + error; + } + } + return null; + }; + + /** + * Creates an AnnotatedString message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.AnnotatedString} AnnotatedString + */ + AnnotatedString.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.AnnotatedString) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.AnnotatedString(); + if (object.textFormatted != null) + message.textFormatted = String(object.textFormatted); + if (object.htmlFormatted != null) + message.htmlFormatted = String(object.htmlFormatted); + if (object.markups) { + if (!Array.isArray(object.markups)) + throw TypeError(".google.cloud.dataqna.v1alpha.AnnotatedString.markups: array expected"); + message.markups = []; + for (var i = 0; i < object.markups.length; ++i) { + if (typeof object.markups[i] !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.AnnotatedString.markups: object expected"); + message.markups[i] = $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup.fromObject(object.markups[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotatedString message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @static + * @param {google.cloud.dataqna.v1alpha.AnnotatedString} message AnnotatedString + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotatedString.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.markups = []; + if (options.defaults) { + object.textFormatted = ""; + object.htmlFormatted = ""; + } + if (message.textFormatted != null && message.hasOwnProperty("textFormatted")) + object.textFormatted = message.textFormatted; + if (message.htmlFormatted != null && message.hasOwnProperty("htmlFormatted")) + object.htmlFormatted = message.htmlFormatted; + if (message.markups && message.markups.length) { + object.markups = []; + for (var j = 0; j < message.markups.length; ++j) + object.markups[j] = $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup.toObject(message.markups[j], options); + } + return object; + }; + + /** + * Converts this AnnotatedString to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @instance + * @returns {Object.} JSON object + */ + AnnotatedString.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AnnotatedString.SemanticMarkup = (function() { + + /** + * Properties of a SemanticMarkup. + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @interface ISemanticMarkup + * @property {google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkupType|null} [type] SemanticMarkup type + * @property {number|null} [startCharIndex] SemanticMarkup startCharIndex + * @property {number|null} [length] SemanticMarkup length + */ + + /** + * Constructs a new SemanticMarkup. + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @classdesc Represents a SemanticMarkup. + * @implements ISemanticMarkup + * @constructor + * @param {google.cloud.dataqna.v1alpha.AnnotatedString.ISemanticMarkup=} [properties] Properties to set + */ + function SemanticMarkup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SemanticMarkup type. + * @member {google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkupType} type + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @instance + */ + SemanticMarkup.prototype.type = 0; + + /** + * SemanticMarkup startCharIndex. + * @member {number} startCharIndex + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @instance + */ + SemanticMarkup.prototype.startCharIndex = 0; + + /** + * SemanticMarkup length. + * @member {number} length + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @instance + */ + SemanticMarkup.prototype.length = 0; + + /** + * Creates a new SemanticMarkup instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @static + * @param {google.cloud.dataqna.v1alpha.AnnotatedString.ISemanticMarkup=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup} SemanticMarkup instance + */ + SemanticMarkup.create = function create(properties) { + return new SemanticMarkup(properties); + }; + + /** + * Encodes the specified SemanticMarkup message. Does not implicitly {@link google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @static + * @param {google.cloud.dataqna.v1alpha.AnnotatedString.ISemanticMarkup} message SemanticMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticMarkup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.startCharIndex != null && Object.hasOwnProperty.call(message, "startCharIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.startCharIndex); + if (message.length != null && Object.hasOwnProperty.call(message, "length")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.length); + return writer; + }; + + /** + * Encodes the specified SemanticMarkup message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @static + * @param {google.cloud.dataqna.v1alpha.AnnotatedString.ISemanticMarkup} message SemanticMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticMarkup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SemanticMarkup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup} SemanticMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticMarkup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.startCharIndex = reader.int32(); + break; + case 3: + message.length = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SemanticMarkup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup} SemanticMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticMarkup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SemanticMarkup message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SemanticMarkup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.startCharIndex != null && message.hasOwnProperty("startCharIndex")) + if (!$util.isInteger(message.startCharIndex)) + return "startCharIndex: integer expected"; + if (message.length != null && message.hasOwnProperty("length")) + if (!$util.isInteger(message.length)) + return "length: integer expected"; + return null; + }; + + /** + * Creates a SemanticMarkup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup} SemanticMarkup + */ + SemanticMarkup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup(); + switch (object.type) { + case "MARKUP_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "METRIC": + case 1: + message.type = 1; + break; + case "DIMENSION": + case 2: + message.type = 2; + break; + case "FILTER": + case 3: + message.type = 3; + break; + case "UNUSED": + case 4: + message.type = 4; + break; + case "BLOCKED": + case 5: + message.type = 5; + break; + case "ROW": + case 6: + message.type = 6; + break; + } + if (object.startCharIndex != null) + message.startCharIndex = object.startCharIndex | 0; + if (object.length != null) + message.length = object.length | 0; + return message; + }; + + /** + * Creates a plain object from a SemanticMarkup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @static + * @param {google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup} message SemanticMarkup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SemanticMarkup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "MARKUP_TYPE_UNSPECIFIED" : 0; + object.startCharIndex = 0; + object.length = 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkupType[message.type] : message.type; + if (message.startCharIndex != null && message.hasOwnProperty("startCharIndex")) + object.startCharIndex = message.startCharIndex; + if (message.length != null && message.hasOwnProperty("length")) + object.length = message.length; + return object; + }; + + /** + * Converts this SemanticMarkup to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @instance + * @returns {Object.} JSON object + */ + SemanticMarkup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SemanticMarkup; + })(); + + /** + * SemanticMarkupType enum. + * @name google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkupType + * @enum {number} + * @property {number} MARKUP_TYPE_UNSPECIFIED=0 MARKUP_TYPE_UNSPECIFIED value + * @property {number} METRIC=1 METRIC value + * @property {number} DIMENSION=2 DIMENSION value + * @property {number} FILTER=3 FILTER value + * @property {number} UNUSED=4 UNUSED value + * @property {number} BLOCKED=5 BLOCKED value + * @property {number} ROW=6 ROW value + */ + AnnotatedString.SemanticMarkupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MARKUP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "METRIC"] = 1; + values[valuesById[2] = "DIMENSION"] = 2; + values[valuesById[3] = "FILTER"] = 3; + values[valuesById[4] = "UNUSED"] = 4; + values[valuesById[5] = "BLOCKED"] = 5; + values[valuesById[6] = "ROW"] = 6; + return values; + })(); + + return AnnotatedString; + })(); + + v1alpha.AutoSuggestionService = (function() { + + /** + * Constructs a new AutoSuggestionService service. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents an AutoSuggestionService + * @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 AutoSuggestionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AutoSuggestionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutoSuggestionService; + + /** + * Creates new AutoSuggestionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataqna.v1alpha.AutoSuggestionService + * @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 {AutoSuggestionService} RPC service. Useful where requests and/or responses are streamed. + */ + AutoSuggestionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.AutoSuggestionService#suggestQueries}. + * @memberof google.cloud.dataqna.v1alpha.AutoSuggestionService + * @typedef SuggestQueriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataqna.v1alpha.SuggestQueriesResponse} [response] SuggestQueriesResponse + */ + + /** + * Calls SuggestQueries. + * @function suggestQueries + * @memberof google.cloud.dataqna.v1alpha.AutoSuggestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.ISuggestQueriesRequest} request SuggestQueriesRequest message or plain object + * @param {google.cloud.dataqna.v1alpha.AutoSuggestionService.SuggestQueriesCallback} callback Node-style callback called with the error, if any, and SuggestQueriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoSuggestionService.prototype.suggestQueries = function suggestQueries(request, callback) { + return this.rpcCall(suggestQueries, $root.google.cloud.dataqna.v1alpha.SuggestQueriesRequest, $root.google.cloud.dataqna.v1alpha.SuggestQueriesResponse, request, callback); + }, "name", { value: "SuggestQueries" }); + + /** + * Calls SuggestQueries. + * @function suggestQueries + * @memberof google.cloud.dataqna.v1alpha.AutoSuggestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.ISuggestQueriesRequest} request SuggestQueriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AutoSuggestionService; + })(); + + v1alpha.SuggestQueriesRequest = (function() { + + /** + * Properties of a SuggestQueriesRequest. + * @memberof google.cloud.dataqna.v1alpha + * @interface ISuggestQueriesRequest + * @property {string|null} [parent] SuggestQueriesRequest parent + * @property {Array.|null} [scopes] SuggestQueriesRequest scopes + * @property {string|null} [query] SuggestQueriesRequest query + * @property {Array.|null} [suggestionTypes] SuggestQueriesRequest suggestionTypes + */ + + /** + * Constructs a new SuggestQueriesRequest. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a SuggestQueriesRequest. + * @implements ISuggestQueriesRequest + * @constructor + * @param {google.cloud.dataqna.v1alpha.ISuggestQueriesRequest=} [properties] Properties to set + */ + function SuggestQueriesRequest(properties) { + this.scopes = []; + this.suggestionTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestQueriesRequest parent. + * @member {string} parent + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @instance + */ + SuggestQueriesRequest.prototype.parent = ""; + + /** + * SuggestQueriesRequest scopes. + * @member {Array.} scopes + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @instance + */ + SuggestQueriesRequest.prototype.scopes = $util.emptyArray; + + /** + * SuggestQueriesRequest query. + * @member {string} query + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @instance + */ + SuggestQueriesRequest.prototype.query = ""; + + /** + * SuggestQueriesRequest suggestionTypes. + * @member {Array.} suggestionTypes + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @instance + */ + SuggestQueriesRequest.prototype.suggestionTypes = $util.emptyArray; + + /** + * Creates a new SuggestQueriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestQueriesRequest=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.SuggestQueriesRequest} SuggestQueriesRequest instance + */ + SuggestQueriesRequest.create = function create(properties) { + return new SuggestQueriesRequest(properties); + }; + + /** + * Encodes the specified SuggestQueriesRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestQueriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestQueriesRequest} message SuggestQueriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestQueriesRequest.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.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.suggestionTypes != null && message.suggestionTypes.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.suggestionTypes.length; ++i) + writer.int32(message.suggestionTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SuggestQueriesRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestQueriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestQueriesRequest} message SuggestQueriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestQueriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestQueriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.SuggestQueriesRequest} SuggestQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestQueriesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.SuggestQueriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + case 3: + message.query = reader.string(); + break; + case 4: + if (!(message.suggestionTypes && message.suggestionTypes.length)) + message.suggestionTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.suggestionTypes.push(reader.int32()); + } else + message.suggestionTypes.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestQueriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.SuggestQueriesRequest} SuggestQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestQueriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestQueriesRequest message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestQueriesRequest.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.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.suggestionTypes != null && message.hasOwnProperty("suggestionTypes")) { + if (!Array.isArray(message.suggestionTypes)) + return "suggestionTypes: array expected"; + for (var i = 0; i < message.suggestionTypes.length; ++i) + switch (message.suggestionTypes[i]) { + default: + return "suggestionTypes: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a SuggestQueriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.SuggestQueriesRequest} SuggestQueriesRequest + */ + SuggestQueriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.SuggestQueriesRequest) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.SuggestQueriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.dataqna.v1alpha.SuggestQueriesRequest.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + if (object.query != null) + message.query = String(object.query); + if (object.suggestionTypes) { + if (!Array.isArray(object.suggestionTypes)) + throw TypeError(".google.cloud.dataqna.v1alpha.SuggestQueriesRequest.suggestionTypes: array expected"); + message.suggestionTypes = []; + for (var i = 0; i < object.suggestionTypes.length; ++i) + switch (object.suggestionTypes[i]) { + default: + case "SUGGESTION_TYPE_UNSPECIFIED": + case 0: + message.suggestionTypes[i] = 0; + break; + case "ENTITY": + case 1: + message.suggestionTypes[i] = 1; + break; + case "TEMPLATE": + case 2: + message.suggestionTypes[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SuggestQueriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @static + * @param {google.cloud.dataqna.v1alpha.SuggestQueriesRequest} message SuggestQueriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestQueriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.scopes = []; + object.suggestionTypes = []; + } + if (options.defaults) { + object.parent = ""; + object.query = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.suggestionTypes && message.suggestionTypes.length) { + object.suggestionTypes = []; + for (var j = 0; j < message.suggestionTypes.length; ++j) + object.suggestionTypes[j] = options.enums === String ? $root.google.cloud.dataqna.v1alpha.SuggestionType[message.suggestionTypes[j]] : message.suggestionTypes[j]; + } + return object; + }; + + /** + * Converts this SuggestQueriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @instance + * @returns {Object.} JSON object + */ + SuggestQueriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestQueriesRequest; + })(); + + v1alpha.Suggestion = (function() { + + /** + * Properties of a Suggestion. + * @memberof google.cloud.dataqna.v1alpha + * @interface ISuggestion + * @property {google.cloud.dataqna.v1alpha.ISuggestionInfo|null} [suggestionInfo] Suggestion suggestionInfo + * @property {number|null} [rankingScore] Suggestion rankingScore + * @property {google.cloud.dataqna.v1alpha.SuggestionType|null} [suggestionType] Suggestion suggestionType + */ + + /** + * Constructs a new Suggestion. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a Suggestion. + * @implements ISuggestion + * @constructor + * @param {google.cloud.dataqna.v1alpha.ISuggestion=} [properties] Properties to set + */ + function Suggestion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Suggestion suggestionInfo. + * @member {google.cloud.dataqna.v1alpha.ISuggestionInfo|null|undefined} suggestionInfo + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @instance + */ + Suggestion.prototype.suggestionInfo = null; + + /** + * Suggestion rankingScore. + * @member {number} rankingScore + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @instance + */ + Suggestion.prototype.rankingScore = 0; + + /** + * Suggestion suggestionType. + * @member {google.cloud.dataqna.v1alpha.SuggestionType} suggestionType + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @instance + */ + Suggestion.prototype.suggestionType = 0; + + /** + * Creates a new Suggestion instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestion=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.Suggestion} Suggestion instance + */ + Suggestion.create = function create(properties) { + return new Suggestion(properties); + }; + + /** + * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dataqna.v1alpha.Suggestion.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestion} message Suggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestionInfo != null && Object.hasOwnProperty.call(message, "suggestionInfo")) + $root.google.cloud.dataqna.v1alpha.SuggestionInfo.encode(message.suggestionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rankingScore != null && Object.hasOwnProperty.call(message, "rankingScore")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.rankingScore); + if (message.suggestionType != null && Object.hasOwnProperty.call(message, "suggestionType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.suggestionType); + return writer; + }; + + /** + * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.Suggestion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestion} message Suggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Suggestion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.Suggestion} Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.Suggestion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.suggestionInfo = $root.google.cloud.dataqna.v1alpha.SuggestionInfo.decode(reader, reader.uint32()); + break; + case 2: + message.rankingScore = reader.double(); + break; + case 3: + message.suggestionType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Suggestion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.Suggestion} Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Suggestion message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Suggestion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestionInfo != null && message.hasOwnProperty("suggestionInfo")) { + var error = $root.google.cloud.dataqna.v1alpha.SuggestionInfo.verify(message.suggestionInfo); + if (error) + return "suggestionInfo." + error; + } + if (message.rankingScore != null && message.hasOwnProperty("rankingScore")) + if (typeof message.rankingScore !== "number") + return "rankingScore: number expected"; + if (message.suggestionType != null && message.hasOwnProperty("suggestionType")) + switch (message.suggestionType) { + default: + return "suggestionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.Suggestion} Suggestion + */ + Suggestion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.Suggestion) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.Suggestion(); + if (object.suggestionInfo != null) { + if (typeof object.suggestionInfo !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.Suggestion.suggestionInfo: object expected"); + message.suggestionInfo = $root.google.cloud.dataqna.v1alpha.SuggestionInfo.fromObject(object.suggestionInfo); + } + if (object.rankingScore != null) + message.rankingScore = Number(object.rankingScore); + switch (object.suggestionType) { + case "SUGGESTION_TYPE_UNSPECIFIED": + case 0: + message.suggestionType = 0; + break; + case "ENTITY": + case 1: + message.suggestionType = 1; + break; + case "TEMPLATE": + case 2: + message.suggestionType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Suggestion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @static + * @param {google.cloud.dataqna.v1alpha.Suggestion} message Suggestion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Suggestion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.suggestionInfo = null; + object.rankingScore = 0; + object.suggestionType = options.enums === String ? "SUGGESTION_TYPE_UNSPECIFIED" : 0; + } + if (message.suggestionInfo != null && message.hasOwnProperty("suggestionInfo")) + object.suggestionInfo = $root.google.cloud.dataqna.v1alpha.SuggestionInfo.toObject(message.suggestionInfo, options); + if (message.rankingScore != null && message.hasOwnProperty("rankingScore")) + object.rankingScore = options.json && !isFinite(message.rankingScore) ? String(message.rankingScore) : message.rankingScore; + if (message.suggestionType != null && message.hasOwnProperty("suggestionType")) + object.suggestionType = options.enums === String ? $root.google.cloud.dataqna.v1alpha.SuggestionType[message.suggestionType] : message.suggestionType; + return object; + }; + + /** + * Converts this Suggestion to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @instance + * @returns {Object.} JSON object + */ + Suggestion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Suggestion; + })(); + + v1alpha.SuggestionInfo = (function() { + + /** + * Properties of a SuggestionInfo. + * @memberof google.cloud.dataqna.v1alpha + * @interface ISuggestionInfo + * @property {google.cloud.dataqna.v1alpha.IAnnotatedString|null} [annotatedSuggestion] SuggestionInfo annotatedSuggestion + * @property {Array.|null} [queryMatches] SuggestionInfo queryMatches + */ + + /** + * Constructs a new SuggestionInfo. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a SuggestionInfo. + * @implements ISuggestionInfo + * @constructor + * @param {google.cloud.dataqna.v1alpha.ISuggestionInfo=} [properties] Properties to set + */ + function SuggestionInfo(properties) { + this.queryMatches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestionInfo annotatedSuggestion. + * @member {google.cloud.dataqna.v1alpha.IAnnotatedString|null|undefined} annotatedSuggestion + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @instance + */ + SuggestionInfo.prototype.annotatedSuggestion = null; + + /** + * SuggestionInfo queryMatches. + * @member {Array.} queryMatches + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @instance + */ + SuggestionInfo.prototype.queryMatches = $util.emptyArray; + + /** + * Creates a new SuggestionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestionInfo=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.SuggestionInfo} SuggestionInfo instance + */ + SuggestionInfo.create = function create(properties) { + return new SuggestionInfo(properties); + }; + + /** + * Encodes the specified SuggestionInfo message. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestionInfo} message SuggestionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotatedSuggestion != null && Object.hasOwnProperty.call(message, "annotatedSuggestion")) + $root.google.cloud.dataqna.v1alpha.AnnotatedString.encode(message.annotatedSuggestion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.queryMatches != null && message.queryMatches.length) + for (var i = 0; i < message.queryMatches.length; ++i) + $root.google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo.encode(message.queryMatches[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SuggestionInfo message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestionInfo} message SuggestionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.SuggestionInfo} SuggestionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.SuggestionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotatedSuggestion = $root.google.cloud.dataqna.v1alpha.AnnotatedString.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.queryMatches && message.queryMatches.length)) + message.queryMatches = []; + message.queryMatches.push($root.google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.SuggestionInfo} SuggestionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestionInfo message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotatedSuggestion != null && message.hasOwnProperty("annotatedSuggestion")) { + var error = $root.google.cloud.dataqna.v1alpha.AnnotatedString.verify(message.annotatedSuggestion); + if (error) + return "annotatedSuggestion." + error; + } + if (message.queryMatches != null && message.hasOwnProperty("queryMatches")) { + if (!Array.isArray(message.queryMatches)) + return "queryMatches: array expected"; + for (var i = 0; i < message.queryMatches.length; ++i) { + var error = $root.google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo.verify(message.queryMatches[i]); + if (error) + return "queryMatches." + error; + } + } + return null; + }; + + /** + * Creates a SuggestionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.SuggestionInfo} SuggestionInfo + */ + SuggestionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.SuggestionInfo) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.SuggestionInfo(); + if (object.annotatedSuggestion != null) { + if (typeof object.annotatedSuggestion !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.SuggestionInfo.annotatedSuggestion: object expected"); + message.annotatedSuggestion = $root.google.cloud.dataqna.v1alpha.AnnotatedString.fromObject(object.annotatedSuggestion); + } + if (object.queryMatches) { + if (!Array.isArray(object.queryMatches)) + throw TypeError(".google.cloud.dataqna.v1alpha.SuggestionInfo.queryMatches: array expected"); + message.queryMatches = []; + for (var i = 0; i < object.queryMatches.length; ++i) { + if (typeof object.queryMatches[i] !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.SuggestionInfo.queryMatches: object expected"); + message.queryMatches[i] = $root.google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo.fromObject(object.queryMatches[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SuggestionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @static + * @param {google.cloud.dataqna.v1alpha.SuggestionInfo} message SuggestionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.queryMatches = []; + if (options.defaults) + object.annotatedSuggestion = null; + if (message.annotatedSuggestion != null && message.hasOwnProperty("annotatedSuggestion")) + object.annotatedSuggestion = $root.google.cloud.dataqna.v1alpha.AnnotatedString.toObject(message.annotatedSuggestion, options); + if (message.queryMatches && message.queryMatches.length) { + object.queryMatches = []; + for (var j = 0; j < message.queryMatches.length; ++j) + object.queryMatches[j] = $root.google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo.toObject(message.queryMatches[j], options); + } + return object; + }; + + /** + * Converts this SuggestionInfo to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @instance + * @returns {Object.} JSON object + */ + SuggestionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SuggestionInfo.MatchInfo = (function() { + + /** + * Properties of a MatchInfo. + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @interface IMatchInfo + * @property {number|null} [startCharIndex] MatchInfo startCharIndex + * @property {number|null} [length] MatchInfo length + */ + + /** + * Constructs a new MatchInfo. + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @classdesc Represents a MatchInfo. + * @implements IMatchInfo + * @constructor + * @param {google.cloud.dataqna.v1alpha.SuggestionInfo.IMatchInfo=} [properties] Properties to set + */ + function MatchInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MatchInfo startCharIndex. + * @member {number} startCharIndex + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @instance + */ + MatchInfo.prototype.startCharIndex = 0; + + /** + * MatchInfo length. + * @member {number} length + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @instance + */ + MatchInfo.prototype.length = 0; + + /** + * Creates a new MatchInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @static + * @param {google.cloud.dataqna.v1alpha.SuggestionInfo.IMatchInfo=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo} MatchInfo instance + */ + MatchInfo.create = function create(properties) { + return new MatchInfo(properties); + }; + + /** + * Encodes the specified MatchInfo message. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @static + * @param {google.cloud.dataqna.v1alpha.SuggestionInfo.IMatchInfo} message MatchInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startCharIndex != null && Object.hasOwnProperty.call(message, "startCharIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startCharIndex); + if (message.length != null && Object.hasOwnProperty.call(message, "length")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.length); + return writer; + }; + + /** + * Encodes the specified MatchInfo message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @static + * @param {google.cloud.dataqna.v1alpha.SuggestionInfo.IMatchInfo} message MatchInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MatchInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo} MatchInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startCharIndex = reader.int32(); + break; + case 2: + message.length = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MatchInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo} MatchInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MatchInfo message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MatchInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startCharIndex != null && message.hasOwnProperty("startCharIndex")) + if (!$util.isInteger(message.startCharIndex)) + return "startCharIndex: integer expected"; + if (message.length != null && message.hasOwnProperty("length")) + if (!$util.isInteger(message.length)) + return "length: integer expected"; + return null; + }; + + /** + * Creates a MatchInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo} MatchInfo + */ + MatchInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo(); + if (object.startCharIndex != null) + message.startCharIndex = object.startCharIndex | 0; + if (object.length != null) + message.length = object.length | 0; + return message; + }; + + /** + * Creates a plain object from a MatchInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @static + * @param {google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo} message MatchInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MatchInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startCharIndex = 0; + object.length = 0; + } + if (message.startCharIndex != null && message.hasOwnProperty("startCharIndex")) + object.startCharIndex = message.startCharIndex; + if (message.length != null && message.hasOwnProperty("length")) + object.length = message.length; + return object; + }; + + /** + * Converts this MatchInfo to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @instance + * @returns {Object.} JSON object + */ + MatchInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MatchInfo; + })(); + + return SuggestionInfo; + })(); + + v1alpha.SuggestQueriesResponse = (function() { + + /** + * Properties of a SuggestQueriesResponse. + * @memberof google.cloud.dataqna.v1alpha + * @interface ISuggestQueriesResponse + * @property {Array.|null} [suggestions] SuggestQueriesResponse suggestions + */ + + /** + * Constructs a new SuggestQueriesResponse. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a SuggestQueriesResponse. + * @implements ISuggestQueriesResponse + * @constructor + * @param {google.cloud.dataqna.v1alpha.ISuggestQueriesResponse=} [properties] Properties to set + */ + function SuggestQueriesResponse(properties) { + this.suggestions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestQueriesResponse suggestions. + * @member {Array.} suggestions + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesResponse + * @instance + */ + SuggestQueriesResponse.prototype.suggestions = $util.emptyArray; + + /** + * Creates a new SuggestQueriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesResponse + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestQueriesResponse=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.SuggestQueriesResponse} SuggestQueriesResponse instance + */ + SuggestQueriesResponse.create = function create(properties) { + return new SuggestQueriesResponse(properties); + }; + + /** + * Encodes the specified SuggestQueriesResponse message. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestQueriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesResponse + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestQueriesResponse} message SuggestQueriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestQueriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestions != null && message.suggestions.length) + for (var i = 0; i < message.suggestions.length; ++i) + $root.google.cloud.dataqna.v1alpha.Suggestion.encode(message.suggestions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SuggestQueriesResponse message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.SuggestQueriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesResponse + * @static + * @param {google.cloud.dataqna.v1alpha.ISuggestQueriesResponse} message SuggestQueriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestQueriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestQueriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.SuggestQueriesResponse} SuggestQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestQueriesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.SuggestQueriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.suggestions && message.suggestions.length)) + message.suggestions = []; + message.suggestions.push($root.google.cloud.dataqna.v1alpha.Suggestion.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestQueriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.SuggestQueriesResponse} SuggestQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestQueriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestQueriesResponse message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestQueriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + if (!Array.isArray(message.suggestions)) + return "suggestions: array expected"; + for (var i = 0; i < message.suggestions.length; ++i) { + var error = $root.google.cloud.dataqna.v1alpha.Suggestion.verify(message.suggestions[i]); + if (error) + return "suggestions." + error; + } + } + return null; + }; + + /** + * Creates a SuggestQueriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.SuggestQueriesResponse} SuggestQueriesResponse + */ + SuggestQueriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.SuggestQueriesResponse) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.SuggestQueriesResponse(); + if (object.suggestions) { + if (!Array.isArray(object.suggestions)) + throw TypeError(".google.cloud.dataqna.v1alpha.SuggestQueriesResponse.suggestions: array expected"); + message.suggestions = []; + for (var i = 0; i < object.suggestions.length; ++i) { + if (typeof object.suggestions[i] !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.SuggestQueriesResponse.suggestions: object expected"); + message.suggestions[i] = $root.google.cloud.dataqna.v1alpha.Suggestion.fromObject(object.suggestions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SuggestQueriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesResponse + * @static + * @param {google.cloud.dataqna.v1alpha.SuggestQueriesResponse} message SuggestQueriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestQueriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.suggestions = []; + if (message.suggestions && message.suggestions.length) { + object.suggestions = []; + for (var j = 0; j < message.suggestions.length; ++j) + object.suggestions[j] = $root.google.cloud.dataqna.v1alpha.Suggestion.toObject(message.suggestions[j], options); + } + return object; + }; + + /** + * Converts this SuggestQueriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesResponse + * @instance + * @returns {Object.} JSON object + */ + SuggestQueriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestQueriesResponse; + })(); + + /** + * SuggestionType enum. + * @name google.cloud.dataqna.v1alpha.SuggestionType + * @enum {number} + * @property {number} SUGGESTION_TYPE_UNSPECIFIED=0 SUGGESTION_TYPE_UNSPECIFIED value + * @property {number} ENTITY=1 ENTITY value + * @property {number} TEMPLATE=2 TEMPLATE value + */ + v1alpha.SuggestionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SUGGESTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENTITY"] = 1; + values[valuesById[2] = "TEMPLATE"] = 2; + return values; + })(); + + v1alpha.Question = (function() { + + /** + * Properties of a Question. + * @memberof google.cloud.dataqna.v1alpha + * @interface IQuestion + * @property {string|null} [name] Question name + * @property {Array.|null} [scopes] Question scopes + * @property {string|null} [query] Question query + * @property {Array.|null} [dataSourceAnnotations] Question dataSourceAnnotations + * @property {google.cloud.dataqna.v1alpha.IInterpretError|null} [interpretError] Question interpretError + * @property {Array.|null} [interpretations] Question interpretations + * @property {google.protobuf.ITimestamp|null} [createTime] Question createTime + * @property {string|null} [userEmail] Question userEmail + * @property {google.cloud.dataqna.v1alpha.IDebugFlags|null} [debugFlags] Question debugFlags + * @property {google.protobuf.IAny|null} [debugInfo] Question debugInfo + */ + + /** + * Constructs a new Question. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a Question. + * @implements IQuestion + * @constructor + * @param {google.cloud.dataqna.v1alpha.IQuestion=} [properties] Properties to set + */ + function Question(properties) { + this.scopes = []; + this.dataSourceAnnotations = []; + this.interpretations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Question name. + * @member {string} name + * @memberof google.cloud.dataqna.v1alpha.Question + * @instance + */ + Question.prototype.name = ""; + + /** + * Question scopes. + * @member {Array.} scopes + * @memberof google.cloud.dataqna.v1alpha.Question + * @instance + */ + Question.prototype.scopes = $util.emptyArray; + + /** + * Question query. + * @member {string} query + * @memberof google.cloud.dataqna.v1alpha.Question + * @instance + */ + Question.prototype.query = ""; + + /** + * Question dataSourceAnnotations. + * @member {Array.} dataSourceAnnotations + * @memberof google.cloud.dataqna.v1alpha.Question + * @instance + */ + Question.prototype.dataSourceAnnotations = $util.emptyArray; + + /** + * Question interpretError. + * @member {google.cloud.dataqna.v1alpha.IInterpretError|null|undefined} interpretError + * @memberof google.cloud.dataqna.v1alpha.Question + * @instance + */ + Question.prototype.interpretError = null; + + /** + * Question interpretations. + * @member {Array.} interpretations + * @memberof google.cloud.dataqna.v1alpha.Question + * @instance + */ + Question.prototype.interpretations = $util.emptyArray; + + /** + * Question createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataqna.v1alpha.Question + * @instance + */ + Question.prototype.createTime = null; + + /** + * Question userEmail. + * @member {string} userEmail + * @memberof google.cloud.dataqna.v1alpha.Question + * @instance + */ + Question.prototype.userEmail = ""; + + /** + * Question debugFlags. + * @member {google.cloud.dataqna.v1alpha.IDebugFlags|null|undefined} debugFlags + * @memberof google.cloud.dataqna.v1alpha.Question + * @instance + */ + Question.prototype.debugFlags = null; + + /** + * Question debugInfo. + * @member {google.protobuf.IAny|null|undefined} debugInfo + * @memberof google.cloud.dataqna.v1alpha.Question + * @instance + */ + Question.prototype.debugInfo = null; + + /** + * Creates a new Question instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.Question + * @static + * @param {google.cloud.dataqna.v1alpha.IQuestion=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.Question} Question instance + */ + Question.create = function create(properties) { + return new Question(properties); + }; + + /** + * Encodes the specified Question message. Does not implicitly {@link google.cloud.dataqna.v1alpha.Question.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.Question + * @static + * @param {google.cloud.dataqna.v1alpha.IQuestion} message Question message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Question.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.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.dataSourceAnnotations != null && message.dataSourceAnnotations.length) + for (var i = 0; i < message.dataSourceAnnotations.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.dataSourceAnnotations[i]); + if (message.interpretError != null && Object.hasOwnProperty.call(message, "interpretError")) + $root.google.cloud.dataqna.v1alpha.InterpretError.encode(message.interpretError, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.interpretations != null && message.interpretations.length) + for (var i = 0; i < message.interpretations.length; ++i) + $root.google.cloud.dataqna.v1alpha.Interpretation.encode(message.interpretations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).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.userEmail != null && Object.hasOwnProperty.call(message, "userEmail")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.userEmail); + if (message.debugFlags != null && Object.hasOwnProperty.call(message, "debugFlags")) + $root.google.cloud.dataqna.v1alpha.DebugFlags.encode(message.debugFlags, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.debugInfo != null && Object.hasOwnProperty.call(message, "debugInfo")) + $root.google.protobuf.Any.encode(message.debugInfo, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Question message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.Question.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.Question + * @static + * @param {google.cloud.dataqna.v1alpha.IQuestion} message Question message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Question.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Question message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.Question + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.Question} Question + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Question.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.Question(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + case 3: + message.query = reader.string(); + break; + case 4: + if (!(message.dataSourceAnnotations && message.dataSourceAnnotations.length)) + message.dataSourceAnnotations = []; + message.dataSourceAnnotations.push(reader.string()); + break; + case 5: + message.interpretError = $root.google.cloud.dataqna.v1alpha.InterpretError.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.interpretations && message.interpretations.length)) + message.interpretations = []; + message.interpretations.push($root.google.cloud.dataqna.v1alpha.Interpretation.decode(reader, reader.uint32())); + break; + case 7: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.userEmail = reader.string(); + break; + case 9: + message.debugFlags = $root.google.cloud.dataqna.v1alpha.DebugFlags.decode(reader, reader.uint32()); + break; + case 10: + message.debugInfo = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Question message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.Question + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.Question} Question + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Question.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Question message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.Question + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Question.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.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.dataSourceAnnotations != null && message.hasOwnProperty("dataSourceAnnotations")) { + if (!Array.isArray(message.dataSourceAnnotations)) + return "dataSourceAnnotations: array expected"; + for (var i = 0; i < message.dataSourceAnnotations.length; ++i) + if (!$util.isString(message.dataSourceAnnotations[i])) + return "dataSourceAnnotations: string[] expected"; + } + if (message.interpretError != null && message.hasOwnProperty("interpretError")) { + var error = $root.google.cloud.dataqna.v1alpha.InterpretError.verify(message.interpretError); + if (error) + return "interpretError." + error; + } + if (message.interpretations != null && message.hasOwnProperty("interpretations")) { + if (!Array.isArray(message.interpretations)) + return "interpretations: array expected"; + for (var i = 0; i < message.interpretations.length; ++i) { + var error = $root.google.cloud.dataqna.v1alpha.Interpretation.verify(message.interpretations[i]); + if (error) + return "interpretations." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.userEmail != null && message.hasOwnProperty("userEmail")) + if (!$util.isString(message.userEmail)) + return "userEmail: string expected"; + if (message.debugFlags != null && message.hasOwnProperty("debugFlags")) { + var error = $root.google.cloud.dataqna.v1alpha.DebugFlags.verify(message.debugFlags); + if (error) + return "debugFlags." + error; + } + if (message.debugInfo != null && message.hasOwnProperty("debugInfo")) { + var error = $root.google.protobuf.Any.verify(message.debugInfo); + if (error) + return "debugInfo." + error; + } + return null; + }; + + /** + * Creates a Question message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.Question + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.Question} Question + */ + Question.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.Question) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.Question(); + if (object.name != null) + message.name = String(object.name); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.dataqna.v1alpha.Question.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + if (object.query != null) + message.query = String(object.query); + if (object.dataSourceAnnotations) { + if (!Array.isArray(object.dataSourceAnnotations)) + throw TypeError(".google.cloud.dataqna.v1alpha.Question.dataSourceAnnotations: array expected"); + message.dataSourceAnnotations = []; + for (var i = 0; i < object.dataSourceAnnotations.length; ++i) + message.dataSourceAnnotations[i] = String(object.dataSourceAnnotations[i]); + } + if (object.interpretError != null) { + if (typeof object.interpretError !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.Question.interpretError: object expected"); + message.interpretError = $root.google.cloud.dataqna.v1alpha.InterpretError.fromObject(object.interpretError); + } + if (object.interpretations) { + if (!Array.isArray(object.interpretations)) + throw TypeError(".google.cloud.dataqna.v1alpha.Question.interpretations: array expected"); + message.interpretations = []; + for (var i = 0; i < object.interpretations.length; ++i) { + if (typeof object.interpretations[i] !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.Question.interpretations: object expected"); + message.interpretations[i] = $root.google.cloud.dataqna.v1alpha.Interpretation.fromObject(object.interpretations[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.Question.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.userEmail != null) + message.userEmail = String(object.userEmail); + if (object.debugFlags != null) { + if (typeof object.debugFlags !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.Question.debugFlags: object expected"); + message.debugFlags = $root.google.cloud.dataqna.v1alpha.DebugFlags.fromObject(object.debugFlags); + } + if (object.debugInfo != null) { + if (typeof object.debugInfo !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.Question.debugInfo: object expected"); + message.debugInfo = $root.google.protobuf.Any.fromObject(object.debugInfo); + } + return message; + }; + + /** + * Creates a plain object from a Question message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.Question + * @static + * @param {google.cloud.dataqna.v1alpha.Question} message Question + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Question.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.scopes = []; + object.dataSourceAnnotations = []; + object.interpretations = []; + } + if (options.defaults) { + object.name = ""; + object.query = ""; + object.interpretError = null; + object.createTime = null; + object.userEmail = ""; + object.debugFlags = null; + object.debugInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.dataSourceAnnotations && message.dataSourceAnnotations.length) { + object.dataSourceAnnotations = []; + for (var j = 0; j < message.dataSourceAnnotations.length; ++j) + object.dataSourceAnnotations[j] = message.dataSourceAnnotations[j]; + } + if (message.interpretError != null && message.hasOwnProperty("interpretError")) + object.interpretError = $root.google.cloud.dataqna.v1alpha.InterpretError.toObject(message.interpretError, options); + if (message.interpretations && message.interpretations.length) { + object.interpretations = []; + for (var j = 0; j < message.interpretations.length; ++j) + object.interpretations[j] = $root.google.cloud.dataqna.v1alpha.Interpretation.toObject(message.interpretations[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.userEmail != null && message.hasOwnProperty("userEmail")) + object.userEmail = message.userEmail; + if (message.debugFlags != null && message.hasOwnProperty("debugFlags")) + object.debugFlags = $root.google.cloud.dataqna.v1alpha.DebugFlags.toObject(message.debugFlags, options); + if (message.debugInfo != null && message.hasOwnProperty("debugInfo")) + object.debugInfo = $root.google.protobuf.Any.toObject(message.debugInfo, options); + return object; + }; + + /** + * Converts this Question to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.Question + * @instance + * @returns {Object.} JSON object + */ + Question.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Question; + })(); + + v1alpha.InterpretError = (function() { + + /** + * Properties of an InterpretError. + * @memberof google.cloud.dataqna.v1alpha + * @interface IInterpretError + * @property {string|null} [message] InterpretError message + * @property {google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorCode|null} [code] InterpretError code + * @property {google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails|null} [details] InterpretError details + */ + + /** + * Constructs a new InterpretError. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents an InterpretError. + * @implements IInterpretError + * @constructor + * @param {google.cloud.dataqna.v1alpha.IInterpretError=} [properties] Properties to set + */ + function InterpretError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterpretError message. + * @member {string} message + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @instance + */ + InterpretError.prototype.message = ""; + + /** + * InterpretError code. + * @member {google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorCode} code + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @instance + */ + InterpretError.prototype.code = 0; + + /** + * InterpretError details. + * @member {google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails|null|undefined} details + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @instance + */ + InterpretError.prototype.details = null; + + /** + * Creates a new InterpretError instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @static + * @param {google.cloud.dataqna.v1alpha.IInterpretError=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.InterpretError} InterpretError instance + */ + InterpretError.create = function create(properties) { + return new InterpretError(properties); + }; + + /** + * Encodes the specified InterpretError message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @static + * @param {google.cloud.dataqna.v1alpha.IInterpretError} message InterpretError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.code); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.encode(message.details, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InterpretError message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @static + * @param {google.cloud.dataqna.v1alpha.IInterpretError} message InterpretError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterpretError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.InterpretError} InterpretError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretError.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.InterpretError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + case 2: + message.code = reader.int32(); + break; + case 3: + message.details = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterpretError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.InterpretError} InterpretError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterpretError message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterpretError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.details != null && message.hasOwnProperty("details")) { + var error = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.verify(message.details); + if (error) + return "details." + error; + } + return null; + }; + + /** + * Creates an InterpretError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.InterpretError} InterpretError + */ + InterpretError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.InterpretError) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.InterpretError(); + if (object.message != null) + message.message = String(object.message); + switch (object.code) { + case "INTERPRET_ERROR_CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "INVALID_QUERY": + case 1: + message.code = 1; + break; + case "FAILED_TO_UNDERSTAND": + case 2: + message.code = 2; + break; + case "FAILED_TO_ANSWER": + case 3: + message.code = 3; + break; + } + if (object.details != null) { + if (typeof object.details !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.InterpretError.details: object expected"); + message.details = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.fromObject(object.details); + } + return message; + }; + + /** + * Creates a plain object from an InterpretError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError} message InterpretError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterpretError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.code = options.enums === String ? "INTERPRET_ERROR_CODE_UNSPECIFIED" : 0; + object.details = null; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorCode[message.code] : message.code; + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.toObject(message.details, options); + return object; + }; + + /** + * Converts this InterpretError to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @instance + * @returns {Object.} JSON object + */ + InterpretError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + InterpretError.InterpretErrorDetails = (function() { + + /** + * Properties of an InterpretErrorDetails. + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @interface IInterpretErrorDetails + * @property {google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails|null} [unsupportedDetails] InterpretErrorDetails unsupportedDetails + * @property {google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails|null} [incompleteQueryDetails] InterpretErrorDetails incompleteQueryDetails + * @property {google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails|null} [ambiguityDetails] InterpretErrorDetails ambiguityDetails + */ + + /** + * Constructs a new InterpretErrorDetails. + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @classdesc Represents an InterpretErrorDetails. + * @implements IInterpretErrorDetails + * @constructor + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails=} [properties] Properties to set + */ + function InterpretErrorDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterpretErrorDetails unsupportedDetails. + * @member {google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails|null|undefined} unsupportedDetails + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @instance + */ + InterpretErrorDetails.prototype.unsupportedDetails = null; + + /** + * InterpretErrorDetails incompleteQueryDetails. + * @member {google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails|null|undefined} incompleteQueryDetails + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @instance + */ + InterpretErrorDetails.prototype.incompleteQueryDetails = null; + + /** + * InterpretErrorDetails ambiguityDetails. + * @member {google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails|null|undefined} ambiguityDetails + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @instance + */ + InterpretErrorDetails.prototype.ambiguityDetails = null; + + /** + * Creates a new InterpretErrorDetails instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails} InterpretErrorDetails instance + */ + InterpretErrorDetails.create = function create(properties) { + return new InterpretErrorDetails(properties); + }; + + /** + * Encodes the specified InterpretErrorDetails message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails} message InterpretErrorDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretErrorDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unsupportedDetails != null && Object.hasOwnProperty.call(message, "unsupportedDetails")) + $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.encode(message.unsupportedDetails, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.incompleteQueryDetails != null && Object.hasOwnProperty.call(message, "incompleteQueryDetails")) + $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.encode(message.incompleteQueryDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ambiguityDetails != null && Object.hasOwnProperty.call(message, "ambiguityDetails")) + $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails.encode(message.ambiguityDetails, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InterpretErrorDetails message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretErrorDetails} message InterpretErrorDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretErrorDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterpretErrorDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails} InterpretErrorDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretErrorDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unsupportedDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.decode(reader, reader.uint32()); + break; + case 2: + message.incompleteQueryDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.decode(reader, reader.uint32()); + break; + case 3: + message.ambiguityDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterpretErrorDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails} InterpretErrorDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretErrorDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterpretErrorDetails message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterpretErrorDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unsupportedDetails != null && message.hasOwnProperty("unsupportedDetails")) { + var error = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.verify(message.unsupportedDetails); + if (error) + return "unsupportedDetails." + error; + } + if (message.incompleteQueryDetails != null && message.hasOwnProperty("incompleteQueryDetails")) { + var error = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.verify(message.incompleteQueryDetails); + if (error) + return "incompleteQueryDetails." + error; + } + if (message.ambiguityDetails != null && message.hasOwnProperty("ambiguityDetails")) { + var error = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails.verify(message.ambiguityDetails); + if (error) + return "ambiguityDetails." + error; + } + return null; + }; + + /** + * Creates an InterpretErrorDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails} InterpretErrorDetails + */ + InterpretErrorDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails(); + if (object.unsupportedDetails != null) { + if (typeof object.unsupportedDetails !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.unsupportedDetails: object expected"); + message.unsupportedDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.fromObject(object.unsupportedDetails); + } + if (object.incompleteQueryDetails != null) { + if (typeof object.incompleteQueryDetails !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.incompleteQueryDetails: object expected"); + message.incompleteQueryDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.fromObject(object.incompleteQueryDetails); + } + if (object.ambiguityDetails != null) { + if (typeof object.ambiguityDetails !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.ambiguityDetails: object expected"); + message.ambiguityDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails.fromObject(object.ambiguityDetails); + } + return message; + }; + + /** + * Creates a plain object from an InterpretErrorDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails} message InterpretErrorDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterpretErrorDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.unsupportedDetails = null; + object.incompleteQueryDetails = null; + object.ambiguityDetails = null; + } + if (message.unsupportedDetails != null && message.hasOwnProperty("unsupportedDetails")) + object.unsupportedDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.toObject(message.unsupportedDetails, options); + if (message.incompleteQueryDetails != null && message.hasOwnProperty("incompleteQueryDetails")) + object.incompleteQueryDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.toObject(message.incompleteQueryDetails, options); + if (message.ambiguityDetails != null && message.hasOwnProperty("ambiguityDetails")) + object.ambiguityDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails.toObject(message.ambiguityDetails, options); + return object; + }; + + /** + * Converts this InterpretErrorDetails to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @instance + * @returns {Object.} JSON object + */ + InterpretErrorDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterpretErrorDetails; + })(); + + InterpretError.InterpretUnsupportedDetails = (function() { + + /** + * Properties of an InterpretUnsupportedDetails. + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @interface IInterpretUnsupportedDetails + * @property {Array.|null} [operators] InterpretUnsupportedDetails operators + * @property {Array.|null} [intent] InterpretUnsupportedDetails intent + */ + + /** + * Constructs a new InterpretUnsupportedDetails. + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @classdesc Represents an InterpretUnsupportedDetails. + * @implements IInterpretUnsupportedDetails + * @constructor + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails=} [properties] Properties to set + */ + function InterpretUnsupportedDetails(properties) { + this.operators = []; + this.intent = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterpretUnsupportedDetails operators. + * @member {Array.} operators + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @instance + */ + InterpretUnsupportedDetails.prototype.operators = $util.emptyArray; + + /** + * InterpretUnsupportedDetails intent. + * @member {Array.} intent + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @instance + */ + InterpretUnsupportedDetails.prototype.intent = $util.emptyArray; + + /** + * Creates a new InterpretUnsupportedDetails instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails} InterpretUnsupportedDetails instance + */ + InterpretUnsupportedDetails.create = function create(properties) { + return new InterpretUnsupportedDetails(properties); + }; + + /** + * Encodes the specified InterpretUnsupportedDetails message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails} message InterpretUnsupportedDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretUnsupportedDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operators != null && message.operators.length) + for (var i = 0; i < message.operators.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operators[i]); + if (message.intent != null && message.intent.length) + for (var i = 0; i < message.intent.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.intent[i]); + return writer; + }; + + /** + * Encodes the specified InterpretUnsupportedDetails message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretUnsupportedDetails} message InterpretUnsupportedDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretUnsupportedDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterpretUnsupportedDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails} InterpretUnsupportedDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretUnsupportedDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.operators && message.operators.length)) + message.operators = []; + message.operators.push(reader.string()); + break; + case 2: + if (!(message.intent && message.intent.length)) + message.intent = []; + message.intent.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterpretUnsupportedDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails} InterpretUnsupportedDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretUnsupportedDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterpretUnsupportedDetails message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterpretUnsupportedDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operators != null && message.hasOwnProperty("operators")) { + if (!Array.isArray(message.operators)) + return "operators: array expected"; + for (var i = 0; i < message.operators.length; ++i) + if (!$util.isString(message.operators[i])) + return "operators: string[] expected"; + } + if (message.intent != null && message.hasOwnProperty("intent")) { + if (!Array.isArray(message.intent)) + return "intent: array expected"; + for (var i = 0; i < message.intent.length; ++i) + if (!$util.isString(message.intent[i])) + return "intent: string[] expected"; + } + return null; + }; + + /** + * Creates an InterpretUnsupportedDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails} InterpretUnsupportedDetails + */ + InterpretUnsupportedDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails(); + if (object.operators) { + if (!Array.isArray(object.operators)) + throw TypeError(".google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.operators: array expected"); + message.operators = []; + for (var i = 0; i < object.operators.length; ++i) + message.operators[i] = String(object.operators[i]); + } + if (object.intent) { + if (!Array.isArray(object.intent)) + throw TypeError(".google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.intent: array expected"); + message.intent = []; + for (var i = 0; i < object.intent.length; ++i) + message.intent[i] = String(object.intent[i]); + } + return message; + }; + + /** + * Creates a plain object from an InterpretUnsupportedDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails} message InterpretUnsupportedDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterpretUnsupportedDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.operators = []; + object.intent = []; + } + if (message.operators && message.operators.length) { + object.operators = []; + for (var j = 0; j < message.operators.length; ++j) + object.operators[j] = message.operators[j]; + } + if (message.intent && message.intent.length) { + object.intent = []; + for (var j = 0; j < message.intent.length; ++j) + object.intent[j] = message.intent[j]; + } + return object; + }; + + /** + * Converts this InterpretUnsupportedDetails to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @instance + * @returns {Object.} JSON object + */ + InterpretUnsupportedDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterpretUnsupportedDetails; + })(); + + InterpretError.InterpretIncompleteQueryDetails = (function() { + + /** + * Properties of an InterpretIncompleteQueryDetails. + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @interface IInterpretIncompleteQueryDetails + * @property {Array.|null} [entities] InterpretIncompleteQueryDetails entities + */ + + /** + * Constructs a new InterpretIncompleteQueryDetails. + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @classdesc Represents an InterpretIncompleteQueryDetails. + * @implements IInterpretIncompleteQueryDetails + * @constructor + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails=} [properties] Properties to set + */ + function InterpretIncompleteQueryDetails(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterpretIncompleteQueryDetails entities. + * @member {Array.} entities + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails + * @instance + */ + InterpretIncompleteQueryDetails.prototype.entities = $util.emptyArray; + + /** + * Creates a new InterpretIncompleteQueryDetails instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails} InterpretIncompleteQueryDetails instance + */ + InterpretIncompleteQueryDetails.create = function create(properties) { + return new InterpretIncompleteQueryDetails(properties); + }; + + /** + * Encodes the specified InterpretIncompleteQueryDetails message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails} message InterpretIncompleteQueryDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretIncompleteQueryDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entities != null && message.entities.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.entities.length; ++i) + writer.int32(message.entities[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified InterpretIncompleteQueryDetails message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretIncompleteQueryDetails} message InterpretIncompleteQueryDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretIncompleteQueryDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterpretIncompleteQueryDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails} InterpretIncompleteQueryDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretIncompleteQueryDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entities && message.entities.length)) + message.entities = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.entities.push(reader.int32()); + } else + message.entities.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterpretIncompleteQueryDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails} InterpretIncompleteQueryDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretIncompleteQueryDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterpretIncompleteQueryDetails message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterpretIncompleteQueryDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) + switch (message.entities[i]) { + default: + return "entities: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates an InterpretIncompleteQueryDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails} InterpretIncompleteQueryDetails + */ + InterpretIncompleteQueryDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails(); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) + switch (object.entities[i]) { + default: + case "INTERPRET_ENTITY_UNSPECIFIED": + case 0: + message.entities[i] = 0; + break; + case "DIMENSION": + case 1: + message.entities[i] = 1; + break; + case "METRIC": + case 2: + message.entities[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from an InterpretIncompleteQueryDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails} message InterpretIncompleteQueryDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterpretIncompleteQueryDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = options.enums === String ? $root.google.cloud.dataqna.v1alpha.InterpretEntity[message.entities[j]] : message.entities[j]; + } + return object; + }; + + /** + * Converts this InterpretIncompleteQueryDetails to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails + * @instance + * @returns {Object.} JSON object + */ + InterpretIncompleteQueryDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterpretIncompleteQueryDetails; + })(); + + InterpretError.InterpretAmbiguityDetails = (function() { + + /** + * Properties of an InterpretAmbiguityDetails. + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @interface IInterpretAmbiguityDetails + */ + + /** + * Constructs a new InterpretAmbiguityDetails. + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @classdesc Represents an InterpretAmbiguityDetails. + * @implements IInterpretAmbiguityDetails + * @constructor + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails=} [properties] Properties to set + */ + function InterpretAmbiguityDetails(properties) { + if (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 InterpretAmbiguityDetails instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails} InterpretAmbiguityDetails instance + */ + InterpretAmbiguityDetails.create = function create(properties) { + return new InterpretAmbiguityDetails(properties); + }; + + /** + * Encodes the specified InterpretAmbiguityDetails message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails} message InterpretAmbiguityDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretAmbiguityDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified InterpretAmbiguityDetails message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.IInterpretAmbiguityDetails} message InterpretAmbiguityDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretAmbiguityDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterpretAmbiguityDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails} InterpretAmbiguityDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretAmbiguityDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterpretAmbiguityDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails} InterpretAmbiguityDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretAmbiguityDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterpretAmbiguityDetails message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterpretAmbiguityDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an InterpretAmbiguityDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails} InterpretAmbiguityDetails + */ + InterpretAmbiguityDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails) + return object; + return new $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails(); + }; + + /** + * Creates a plain object from an InterpretAmbiguityDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails} message InterpretAmbiguityDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterpretAmbiguityDetails.toObject = function toObject() { + return {}; + }; + + /** + * Converts this InterpretAmbiguityDetails to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails + * @instance + * @returns {Object.} JSON object + */ + InterpretAmbiguityDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterpretAmbiguityDetails; + })(); + + /** + * InterpretErrorCode enum. + * @name google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorCode + * @enum {number} + * @property {number} INTERPRET_ERROR_CODE_UNSPECIFIED=0 INTERPRET_ERROR_CODE_UNSPECIFIED value + * @property {number} INVALID_QUERY=1 INVALID_QUERY value + * @property {number} FAILED_TO_UNDERSTAND=2 FAILED_TO_UNDERSTAND value + * @property {number} FAILED_TO_ANSWER=3 FAILED_TO_ANSWER value + */ + InterpretError.InterpretErrorCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERPRET_ERROR_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INVALID_QUERY"] = 1; + values[valuesById[2] = "FAILED_TO_UNDERSTAND"] = 2; + values[valuesById[3] = "FAILED_TO_ANSWER"] = 3; + return values; + })(); + + return InterpretError; + })(); + + v1alpha.ExecutionInfo = (function() { + + /** + * Properties of an ExecutionInfo. + * @memberof google.cloud.dataqna.v1alpha + * @interface IExecutionInfo + * @property {google.rpc.IStatus|null} [jobCreationStatus] ExecutionInfo jobCreationStatus + * @property {google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState|null} [jobExecutionState] ExecutionInfo jobExecutionState + * @property {google.protobuf.ITimestamp|null} [createTime] ExecutionInfo createTime + * @property {google.cloud.dataqna.v1alpha.IBigQueryJob|null} [bigqueryJob] ExecutionInfo bigqueryJob + */ + + /** + * Constructs a new ExecutionInfo. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents an ExecutionInfo. + * @implements IExecutionInfo + * @constructor + * @param {google.cloud.dataqna.v1alpha.IExecutionInfo=} [properties] Properties to set + */ + function ExecutionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutionInfo jobCreationStatus. + * @member {google.rpc.IStatus|null|undefined} jobCreationStatus + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @instance + */ + ExecutionInfo.prototype.jobCreationStatus = null; + + /** + * ExecutionInfo jobExecutionState. + * @member {google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState} jobExecutionState + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @instance + */ + ExecutionInfo.prototype.jobExecutionState = 0; + + /** + * ExecutionInfo createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @instance + */ + ExecutionInfo.prototype.createTime = null; + + /** + * ExecutionInfo bigqueryJob. + * @member {google.cloud.dataqna.v1alpha.IBigQueryJob|null|undefined} bigqueryJob + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @instance + */ + ExecutionInfo.prototype.bigqueryJob = null; + + /** + * Creates a new ExecutionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @static + * @param {google.cloud.dataqna.v1alpha.IExecutionInfo=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.ExecutionInfo} ExecutionInfo instance + */ + ExecutionInfo.create = function create(properties) { + return new ExecutionInfo(properties); + }; + + /** + * Encodes the specified ExecutionInfo message. Does not implicitly {@link google.cloud.dataqna.v1alpha.ExecutionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @static + * @param {google.cloud.dataqna.v1alpha.IExecutionInfo} message ExecutionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobCreationStatus != null && Object.hasOwnProperty.call(message, "jobCreationStatus")) + $root.google.rpc.Status.encode(message.jobCreationStatus, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.jobExecutionState != null && Object.hasOwnProperty.call(message, "jobExecutionState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.jobExecutionState); + 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.bigqueryJob != null && Object.hasOwnProperty.call(message, "bigqueryJob")) + $root.google.cloud.dataqna.v1alpha.BigQueryJob.encode(message.bigqueryJob, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecutionInfo message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.ExecutionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @static + * @param {google.cloud.dataqna.v1alpha.IExecutionInfo} message ExecutionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.ExecutionInfo} ExecutionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.ExecutionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobCreationStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 2: + message.jobExecutionState = reader.int32(); + break; + case 3: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.bigqueryJob = $root.google.cloud.dataqna.v1alpha.BigQueryJob.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.ExecutionInfo} ExecutionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutionInfo message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobCreationStatus != null && message.hasOwnProperty("jobCreationStatus")) { + var error = $root.google.rpc.Status.verify(message.jobCreationStatus); + if (error) + return "jobCreationStatus." + error; + } + if (message.jobExecutionState != null && message.hasOwnProperty("jobExecutionState")) + switch (message.jobExecutionState) { + default: + return "jobExecutionState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.bigqueryJob != null && message.hasOwnProperty("bigqueryJob")) { + var error = $root.google.cloud.dataqna.v1alpha.BigQueryJob.verify(message.bigqueryJob); + if (error) + return "bigqueryJob." + error; + } + return null; + }; + + /** + * Creates an ExecutionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.ExecutionInfo} ExecutionInfo + */ + ExecutionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.ExecutionInfo) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.ExecutionInfo(); + if (object.jobCreationStatus != null) { + if (typeof object.jobCreationStatus !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.ExecutionInfo.jobCreationStatus: object expected"); + message.jobCreationStatus = $root.google.rpc.Status.fromObject(object.jobCreationStatus); + } + switch (object.jobExecutionState) { + case "JOB_EXECUTION_STATE_UNSPECIFIED": + case 0: + message.jobExecutionState = 0; + break; + case "NOT_EXECUTED": + case 1: + message.jobExecutionState = 1; + break; + case "RUNNING": + case 2: + message.jobExecutionState = 2; + break; + case "SUCCEEDED": + case 3: + message.jobExecutionState = 3; + break; + case "FAILED": + case 4: + message.jobExecutionState = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.ExecutionInfo.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.bigqueryJob != null) { + if (typeof object.bigqueryJob !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.ExecutionInfo.bigqueryJob: object expected"); + message.bigqueryJob = $root.google.cloud.dataqna.v1alpha.BigQueryJob.fromObject(object.bigqueryJob); + } + return message; + }; + + /** + * Creates a plain object from an ExecutionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @static + * @param {google.cloud.dataqna.v1alpha.ExecutionInfo} message ExecutionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.jobCreationStatus = null; + object.jobExecutionState = options.enums === String ? "JOB_EXECUTION_STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.bigqueryJob = null; + } + if (message.jobCreationStatus != null && message.hasOwnProperty("jobCreationStatus")) + object.jobCreationStatus = $root.google.rpc.Status.toObject(message.jobCreationStatus, options); + if (message.jobExecutionState != null && message.hasOwnProperty("jobExecutionState")) + object.jobExecutionState = options.enums === String ? $root.google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState[message.jobExecutionState] : message.jobExecutionState; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.bigqueryJob != null && message.hasOwnProperty("bigqueryJob")) + object.bigqueryJob = $root.google.cloud.dataqna.v1alpha.BigQueryJob.toObject(message.bigqueryJob, options); + return object; + }; + + /** + * Converts this ExecutionInfo to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @instance + * @returns {Object.} JSON object + */ + ExecutionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * JobExecutionState enum. + * @name google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState + * @enum {number} + * @property {number} JOB_EXECUTION_STATE_UNSPECIFIED=0 JOB_EXECUTION_STATE_UNSPECIFIED value + * @property {number} NOT_EXECUTED=1 NOT_EXECUTED value + * @property {number} RUNNING=2 RUNNING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + */ + ExecutionInfo.JobExecutionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_EXECUTION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOT_EXECUTED"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); + + return ExecutionInfo; + })(); + + v1alpha.BigQueryJob = (function() { + + /** + * Properties of a BigQueryJob. + * @memberof google.cloud.dataqna.v1alpha + * @interface IBigQueryJob + * @property {string|null} [jobId] BigQueryJob jobId + * @property {string|null} [projectId] BigQueryJob projectId + * @property {string|null} [location] BigQueryJob location + */ + + /** + * Constructs a new BigQueryJob. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a BigQueryJob. + * @implements IBigQueryJob + * @constructor + * @param {google.cloud.dataqna.v1alpha.IBigQueryJob=} [properties] Properties to set + */ + function BigQueryJob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryJob jobId. + * @member {string} jobId + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @instance + */ + BigQueryJob.prototype.jobId = ""; + + /** + * BigQueryJob projectId. + * @member {string} projectId + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @instance + */ + BigQueryJob.prototype.projectId = ""; + + /** + * BigQueryJob location. + * @member {string} location + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @instance + */ + BigQueryJob.prototype.location = ""; + + /** + * Creates a new BigQueryJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @static + * @param {google.cloud.dataqna.v1alpha.IBigQueryJob=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.BigQueryJob} BigQueryJob instance + */ + BigQueryJob.create = function create(properties) { + return new BigQueryJob(properties); + }; + + /** + * Encodes the specified BigQueryJob message. Does not implicitly {@link google.cloud.dataqna.v1alpha.BigQueryJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @static + * @param {google.cloud.dataqna.v1alpha.IBigQueryJob} message BigQueryJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.jobId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + return writer; + }; + + /** + * Encodes the specified BigQueryJob message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.BigQueryJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @static + * @param {google.cloud.dataqna.v1alpha.IBigQueryJob} message BigQueryJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.BigQueryJob} BigQueryJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.BigQueryJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + case 2: + message.projectId = reader.string(); + break; + case 3: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.BigQueryJob} BigQueryJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryJob message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a BigQueryJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.BigQueryJob} BigQueryJob + */ + BigQueryJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.BigQueryJob) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.BigQueryJob(); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a BigQueryJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @static + * @param {google.cloud.dataqna.v1alpha.BigQueryJob} message BigQueryJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.jobId = ""; + object.projectId = ""; + object.location = ""; + } + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this BigQueryJob to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @instance + * @returns {Object.} JSON object + */ + BigQueryJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BigQueryJob; + })(); + + v1alpha.Interpretation = (function() { + + /** + * Properties of an Interpretation. + * @memberof google.cloud.dataqna.v1alpha + * @interface IInterpretation + * @property {Array.|null} [dataSources] Interpretation dataSources + * @property {number|null} [confidence] Interpretation confidence + * @property {Array.|null} [unusedPhrases] Interpretation unusedPhrases + * @property {google.cloud.dataqna.v1alpha.IHumanReadable|null} [humanReadable] Interpretation humanReadable + * @property {google.cloud.dataqna.v1alpha.IInterpretationStructure|null} [interpretationStructure] Interpretation interpretationStructure + * @property {google.cloud.dataqna.v1alpha.IDataQuery|null} [dataQuery] Interpretation dataQuery + * @property {google.cloud.dataqna.v1alpha.IExecutionInfo|null} [executionInfo] Interpretation executionInfo + */ + + /** + * Constructs a new Interpretation. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents an Interpretation. + * @implements IInterpretation + * @constructor + * @param {google.cloud.dataqna.v1alpha.IInterpretation=} [properties] Properties to set + */ + function Interpretation(properties) { + this.dataSources = []; + this.unusedPhrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Interpretation dataSources. + * @member {Array.} dataSources + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @instance + */ + Interpretation.prototype.dataSources = $util.emptyArray; + + /** + * Interpretation confidence. + * @member {number} confidence + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @instance + */ + Interpretation.prototype.confidence = 0; + + /** + * Interpretation unusedPhrases. + * @member {Array.} unusedPhrases + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @instance + */ + Interpretation.prototype.unusedPhrases = $util.emptyArray; + + /** + * Interpretation humanReadable. + * @member {google.cloud.dataqna.v1alpha.IHumanReadable|null|undefined} humanReadable + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @instance + */ + Interpretation.prototype.humanReadable = null; + + /** + * Interpretation interpretationStructure. + * @member {google.cloud.dataqna.v1alpha.IInterpretationStructure|null|undefined} interpretationStructure + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @instance + */ + Interpretation.prototype.interpretationStructure = null; + + /** + * Interpretation dataQuery. + * @member {google.cloud.dataqna.v1alpha.IDataQuery|null|undefined} dataQuery + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @instance + */ + Interpretation.prototype.dataQuery = null; + + /** + * Interpretation executionInfo. + * @member {google.cloud.dataqna.v1alpha.IExecutionInfo|null|undefined} executionInfo + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @instance + */ + Interpretation.prototype.executionInfo = null; + + /** + * Creates a new Interpretation instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @static + * @param {google.cloud.dataqna.v1alpha.IInterpretation=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.Interpretation} Interpretation instance + */ + Interpretation.create = function create(properties) { + return new Interpretation(properties); + }; + + /** + * Encodes the specified Interpretation message. Does not implicitly {@link google.cloud.dataqna.v1alpha.Interpretation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @static + * @param {google.cloud.dataqna.v1alpha.IInterpretation} message Interpretation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interpretation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSources != null && message.dataSources.length) + for (var i = 0; i < message.dataSources.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataSources[i]); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.confidence); + if (message.unusedPhrases != null && message.unusedPhrases.length) + for (var i = 0; i < message.unusedPhrases.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unusedPhrases[i]); + if (message.humanReadable != null && Object.hasOwnProperty.call(message, "humanReadable")) + $root.google.cloud.dataqna.v1alpha.HumanReadable.encode(message.humanReadable, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.interpretationStructure != null && Object.hasOwnProperty.call(message, "interpretationStructure")) + $root.google.cloud.dataqna.v1alpha.InterpretationStructure.encode(message.interpretationStructure, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.dataQuery != null && Object.hasOwnProperty.call(message, "dataQuery")) + $root.google.cloud.dataqna.v1alpha.DataQuery.encode(message.dataQuery, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.executionInfo != null && Object.hasOwnProperty.call(message, "executionInfo")) + $root.google.cloud.dataqna.v1alpha.ExecutionInfo.encode(message.executionInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Interpretation message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.Interpretation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @static + * @param {google.cloud.dataqna.v1alpha.IInterpretation} message Interpretation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interpretation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interpretation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.Interpretation} Interpretation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interpretation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.Interpretation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dataSources && message.dataSources.length)) + message.dataSources = []; + message.dataSources.push(reader.string()); + break; + case 2: + message.confidence = reader.double(); + break; + case 3: + if (!(message.unusedPhrases && message.unusedPhrases.length)) + message.unusedPhrases = []; + message.unusedPhrases.push(reader.string()); + break; + case 4: + message.humanReadable = $root.google.cloud.dataqna.v1alpha.HumanReadable.decode(reader, reader.uint32()); + break; + case 5: + message.interpretationStructure = $root.google.cloud.dataqna.v1alpha.InterpretationStructure.decode(reader, reader.uint32()); + break; + case 6: + message.dataQuery = $root.google.cloud.dataqna.v1alpha.DataQuery.decode(reader, reader.uint32()); + break; + case 7: + message.executionInfo = $root.google.cloud.dataqna.v1alpha.ExecutionInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Interpretation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.Interpretation} Interpretation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interpretation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interpretation message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interpretation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataSources != null && message.hasOwnProperty("dataSources")) { + if (!Array.isArray(message.dataSources)) + return "dataSources: array expected"; + for (var i = 0; i < message.dataSources.length; ++i) + if (!$util.isString(message.dataSources[i])) + return "dataSources: string[] expected"; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.unusedPhrases != null && message.hasOwnProperty("unusedPhrases")) { + if (!Array.isArray(message.unusedPhrases)) + return "unusedPhrases: array expected"; + for (var i = 0; i < message.unusedPhrases.length; ++i) + if (!$util.isString(message.unusedPhrases[i])) + return "unusedPhrases: string[] expected"; + } + if (message.humanReadable != null && message.hasOwnProperty("humanReadable")) { + var error = $root.google.cloud.dataqna.v1alpha.HumanReadable.verify(message.humanReadable); + if (error) + return "humanReadable." + error; + } + if (message.interpretationStructure != null && message.hasOwnProperty("interpretationStructure")) { + var error = $root.google.cloud.dataqna.v1alpha.InterpretationStructure.verify(message.interpretationStructure); + if (error) + return "interpretationStructure." + error; + } + if (message.dataQuery != null && message.hasOwnProperty("dataQuery")) { + var error = $root.google.cloud.dataqna.v1alpha.DataQuery.verify(message.dataQuery); + if (error) + return "dataQuery." + error; + } + if (message.executionInfo != null && message.hasOwnProperty("executionInfo")) { + var error = $root.google.cloud.dataqna.v1alpha.ExecutionInfo.verify(message.executionInfo); + if (error) + return "executionInfo." + error; + } + return null; + }; + + /** + * Creates an Interpretation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.Interpretation} Interpretation + */ + Interpretation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.Interpretation) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.Interpretation(); + if (object.dataSources) { + if (!Array.isArray(object.dataSources)) + throw TypeError(".google.cloud.dataqna.v1alpha.Interpretation.dataSources: array expected"); + message.dataSources = []; + for (var i = 0; i < object.dataSources.length; ++i) + message.dataSources[i] = String(object.dataSources[i]); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.unusedPhrases) { + if (!Array.isArray(object.unusedPhrases)) + throw TypeError(".google.cloud.dataqna.v1alpha.Interpretation.unusedPhrases: array expected"); + message.unusedPhrases = []; + for (var i = 0; i < object.unusedPhrases.length; ++i) + message.unusedPhrases[i] = String(object.unusedPhrases[i]); + } + if (object.humanReadable != null) { + if (typeof object.humanReadable !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.Interpretation.humanReadable: object expected"); + message.humanReadable = $root.google.cloud.dataqna.v1alpha.HumanReadable.fromObject(object.humanReadable); + } + if (object.interpretationStructure != null) { + if (typeof object.interpretationStructure !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.Interpretation.interpretationStructure: object expected"); + message.interpretationStructure = $root.google.cloud.dataqna.v1alpha.InterpretationStructure.fromObject(object.interpretationStructure); + } + if (object.dataQuery != null) { + if (typeof object.dataQuery !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.Interpretation.dataQuery: object expected"); + message.dataQuery = $root.google.cloud.dataqna.v1alpha.DataQuery.fromObject(object.dataQuery); + } + if (object.executionInfo != null) { + if (typeof object.executionInfo !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.Interpretation.executionInfo: object expected"); + message.executionInfo = $root.google.cloud.dataqna.v1alpha.ExecutionInfo.fromObject(object.executionInfo); + } + return message; + }; + + /** + * Creates a plain object from an Interpretation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @static + * @param {google.cloud.dataqna.v1alpha.Interpretation} message Interpretation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interpretation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataSources = []; + object.unusedPhrases = []; + } + if (options.defaults) { + object.confidence = 0; + object.humanReadable = null; + object.interpretationStructure = null; + object.dataQuery = null; + object.executionInfo = null; + } + if (message.dataSources && message.dataSources.length) { + object.dataSources = []; + for (var j = 0; j < message.dataSources.length; ++j) + object.dataSources[j] = message.dataSources[j]; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.unusedPhrases && message.unusedPhrases.length) { + object.unusedPhrases = []; + for (var j = 0; j < message.unusedPhrases.length; ++j) + object.unusedPhrases[j] = message.unusedPhrases[j]; + } + if (message.humanReadable != null && message.hasOwnProperty("humanReadable")) + object.humanReadable = $root.google.cloud.dataqna.v1alpha.HumanReadable.toObject(message.humanReadable, options); + if (message.interpretationStructure != null && message.hasOwnProperty("interpretationStructure")) + object.interpretationStructure = $root.google.cloud.dataqna.v1alpha.InterpretationStructure.toObject(message.interpretationStructure, options); + if (message.dataQuery != null && message.hasOwnProperty("dataQuery")) + object.dataQuery = $root.google.cloud.dataqna.v1alpha.DataQuery.toObject(message.dataQuery, options); + if (message.executionInfo != null && message.hasOwnProperty("executionInfo")) + object.executionInfo = $root.google.cloud.dataqna.v1alpha.ExecutionInfo.toObject(message.executionInfo, options); + return object; + }; + + /** + * Converts this Interpretation to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @instance + * @returns {Object.} JSON object + */ + Interpretation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Interpretation; + })(); + + v1alpha.DataQuery = (function() { + + /** + * Properties of a DataQuery. + * @memberof google.cloud.dataqna.v1alpha + * @interface IDataQuery + * @property {string|null} [sql] DataQuery sql + */ + + /** + * Constructs a new DataQuery. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a DataQuery. + * @implements IDataQuery + * @constructor + * @param {google.cloud.dataqna.v1alpha.IDataQuery=} [properties] Properties to set + */ + function DataQuery(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataQuery sql. + * @member {string} sql + * @memberof google.cloud.dataqna.v1alpha.DataQuery + * @instance + */ + DataQuery.prototype.sql = ""; + + /** + * Creates a new DataQuery instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.DataQuery + * @static + * @param {google.cloud.dataqna.v1alpha.IDataQuery=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.DataQuery} DataQuery instance + */ + DataQuery.create = function create(properties) { + return new DataQuery(properties); + }; + + /** + * Encodes the specified DataQuery message. Does not implicitly {@link google.cloud.dataqna.v1alpha.DataQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.DataQuery + * @static + * @param {google.cloud.dataqna.v1alpha.IDataQuery} message DataQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql); + return writer; + }; + + /** + * Encodes the specified DataQuery message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.DataQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.DataQuery + * @static + * @param {google.cloud.dataqna.v1alpha.IDataQuery} message DataQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.DataQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.DataQuery} DataQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.DataQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sql = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.DataQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.DataQuery} DataQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataQuery message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.DataQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + return null; + }; + + /** + * Creates a DataQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.DataQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.DataQuery} DataQuery + */ + DataQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.DataQuery) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.DataQuery(); + if (object.sql != null) + message.sql = String(object.sql); + return message; + }; + + /** + * Creates a plain object from a DataQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.DataQuery + * @static + * @param {google.cloud.dataqna.v1alpha.DataQuery} message DataQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sql = ""; + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + return object; + }; + + /** + * Converts this DataQuery to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.DataQuery + * @instance + * @returns {Object.} JSON object + */ + DataQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataQuery; + })(); + + v1alpha.HumanReadable = (function() { + + /** + * Properties of a HumanReadable. + * @memberof google.cloud.dataqna.v1alpha + * @interface IHumanReadable + * @property {google.cloud.dataqna.v1alpha.IAnnotatedString|null} [generatedInterpretation] HumanReadable generatedInterpretation + * @property {google.cloud.dataqna.v1alpha.IAnnotatedString|null} [originalQuestion] HumanReadable originalQuestion + */ + + /** + * Constructs a new HumanReadable. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a HumanReadable. + * @implements IHumanReadable + * @constructor + * @param {google.cloud.dataqna.v1alpha.IHumanReadable=} [properties] Properties to set + */ + function HumanReadable(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HumanReadable generatedInterpretation. + * @member {google.cloud.dataqna.v1alpha.IAnnotatedString|null|undefined} generatedInterpretation + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @instance + */ + HumanReadable.prototype.generatedInterpretation = null; + + /** + * HumanReadable originalQuestion. + * @member {google.cloud.dataqna.v1alpha.IAnnotatedString|null|undefined} originalQuestion + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @instance + */ + HumanReadable.prototype.originalQuestion = null; + + /** + * Creates a new HumanReadable instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @static + * @param {google.cloud.dataqna.v1alpha.IHumanReadable=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.HumanReadable} HumanReadable instance + */ + HumanReadable.create = function create(properties) { + return new HumanReadable(properties); + }; + + /** + * Encodes the specified HumanReadable message. Does not implicitly {@link google.cloud.dataqna.v1alpha.HumanReadable.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @static + * @param {google.cloud.dataqna.v1alpha.IHumanReadable} message HumanReadable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanReadable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generatedInterpretation != null && Object.hasOwnProperty.call(message, "generatedInterpretation")) + $root.google.cloud.dataqna.v1alpha.AnnotatedString.encode(message.generatedInterpretation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.originalQuestion != null && Object.hasOwnProperty.call(message, "originalQuestion")) + $root.google.cloud.dataqna.v1alpha.AnnotatedString.encode(message.originalQuestion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HumanReadable message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.HumanReadable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @static + * @param {google.cloud.dataqna.v1alpha.IHumanReadable} message HumanReadable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanReadable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HumanReadable message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.HumanReadable} HumanReadable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanReadable.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.HumanReadable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.generatedInterpretation = $root.google.cloud.dataqna.v1alpha.AnnotatedString.decode(reader, reader.uint32()); + break; + case 2: + message.originalQuestion = $root.google.cloud.dataqna.v1alpha.AnnotatedString.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HumanReadable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.HumanReadable} HumanReadable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanReadable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HumanReadable message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HumanReadable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.generatedInterpretation != null && message.hasOwnProperty("generatedInterpretation")) { + var error = $root.google.cloud.dataqna.v1alpha.AnnotatedString.verify(message.generatedInterpretation); + if (error) + return "generatedInterpretation." + error; + } + if (message.originalQuestion != null && message.hasOwnProperty("originalQuestion")) { + var error = $root.google.cloud.dataqna.v1alpha.AnnotatedString.verify(message.originalQuestion); + if (error) + return "originalQuestion." + error; + } + return null; + }; + + /** + * Creates a HumanReadable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.HumanReadable} HumanReadable + */ + HumanReadable.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.HumanReadable) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.HumanReadable(); + if (object.generatedInterpretation != null) { + if (typeof object.generatedInterpretation !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.HumanReadable.generatedInterpretation: object expected"); + message.generatedInterpretation = $root.google.cloud.dataqna.v1alpha.AnnotatedString.fromObject(object.generatedInterpretation); + } + if (object.originalQuestion != null) { + if (typeof object.originalQuestion !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.HumanReadable.originalQuestion: object expected"); + message.originalQuestion = $root.google.cloud.dataqna.v1alpha.AnnotatedString.fromObject(object.originalQuestion); + } + return message; + }; + + /** + * Creates a plain object from a HumanReadable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @static + * @param {google.cloud.dataqna.v1alpha.HumanReadable} message HumanReadable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HumanReadable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.generatedInterpretation = null; + object.originalQuestion = null; + } + if (message.generatedInterpretation != null && message.hasOwnProperty("generatedInterpretation")) + object.generatedInterpretation = $root.google.cloud.dataqna.v1alpha.AnnotatedString.toObject(message.generatedInterpretation, options); + if (message.originalQuestion != null && message.hasOwnProperty("originalQuestion")) + object.originalQuestion = $root.google.cloud.dataqna.v1alpha.AnnotatedString.toObject(message.originalQuestion, options); + return object; + }; + + /** + * Converts this HumanReadable to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @instance + * @returns {Object.} JSON object + */ + HumanReadable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HumanReadable; + })(); + + v1alpha.InterpretationStructure = (function() { + + /** + * Properties of an InterpretationStructure. + * @memberof google.cloud.dataqna.v1alpha + * @interface IInterpretationStructure + * @property {Array.|null} [visualizationTypes] InterpretationStructure visualizationTypes + * @property {Array.|null} [columnInfo] InterpretationStructure columnInfo + */ + + /** + * Constructs a new InterpretationStructure. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents an InterpretationStructure. + * @implements IInterpretationStructure + * @constructor + * @param {google.cloud.dataqna.v1alpha.IInterpretationStructure=} [properties] Properties to set + */ + function InterpretationStructure(properties) { + this.visualizationTypes = []; + this.columnInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterpretationStructure visualizationTypes. + * @member {Array.} visualizationTypes + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @instance + */ + InterpretationStructure.prototype.visualizationTypes = $util.emptyArray; + + /** + * InterpretationStructure columnInfo. + * @member {Array.} columnInfo + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @instance + */ + InterpretationStructure.prototype.columnInfo = $util.emptyArray; + + /** + * Creates a new InterpretationStructure instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @static + * @param {google.cloud.dataqna.v1alpha.IInterpretationStructure=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.InterpretationStructure} InterpretationStructure instance + */ + InterpretationStructure.create = function create(properties) { + return new InterpretationStructure(properties); + }; + + /** + * Encodes the specified InterpretationStructure message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretationStructure.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @static + * @param {google.cloud.dataqna.v1alpha.IInterpretationStructure} message InterpretationStructure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretationStructure.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.visualizationTypes != null && message.visualizationTypes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.visualizationTypes.length; ++i) + writer.int32(message.visualizationTypes[i]); + writer.ldelim(); + } + if (message.columnInfo != null && message.columnInfo.length) + for (var i = 0; i < message.columnInfo.length; ++i) + $root.google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo.encode(message.columnInfo[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InterpretationStructure message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretationStructure.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @static + * @param {google.cloud.dataqna.v1alpha.IInterpretationStructure} message InterpretationStructure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterpretationStructure.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterpretationStructure message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.InterpretationStructure} InterpretationStructure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretationStructure.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.InterpretationStructure(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.visualizationTypes && message.visualizationTypes.length)) + message.visualizationTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.visualizationTypes.push(reader.int32()); + } else + message.visualizationTypes.push(reader.int32()); + break; + case 2: + if (!(message.columnInfo && message.columnInfo.length)) + message.columnInfo = []; + message.columnInfo.push($root.google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterpretationStructure message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.InterpretationStructure} InterpretationStructure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterpretationStructure.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterpretationStructure message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterpretationStructure.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.visualizationTypes != null && message.hasOwnProperty("visualizationTypes")) { + if (!Array.isArray(message.visualizationTypes)) + return "visualizationTypes: array expected"; + for (var i = 0; i < message.visualizationTypes.length; ++i) + switch (message.visualizationTypes[i]) { + default: + return "visualizationTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + } + if (message.columnInfo != null && message.hasOwnProperty("columnInfo")) { + if (!Array.isArray(message.columnInfo)) + return "columnInfo: array expected"; + for (var i = 0; i < message.columnInfo.length; ++i) { + var error = $root.google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo.verify(message.columnInfo[i]); + if (error) + return "columnInfo." + error; + } + } + return null; + }; + + /** + * Creates an InterpretationStructure message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.InterpretationStructure} InterpretationStructure + */ + InterpretationStructure.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.InterpretationStructure) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.InterpretationStructure(); + if (object.visualizationTypes) { + if (!Array.isArray(object.visualizationTypes)) + throw TypeError(".google.cloud.dataqna.v1alpha.InterpretationStructure.visualizationTypes: array expected"); + message.visualizationTypes = []; + for (var i = 0; i < object.visualizationTypes.length; ++i) + switch (object.visualizationTypes[i]) { + default: + case "VISUALIZATION_TYPE_UNSPECIFIED": + case 0: + message.visualizationTypes[i] = 0; + break; + case "TABLE": + case 1: + message.visualizationTypes[i] = 1; + break; + case "BAR_CHART": + case 2: + message.visualizationTypes[i] = 2; + break; + case "COLUMN_CHART": + case 3: + message.visualizationTypes[i] = 3; + break; + case "TIMELINE": + case 4: + message.visualizationTypes[i] = 4; + break; + case "SCATTER_PLOT": + case 5: + message.visualizationTypes[i] = 5; + break; + case "PIE_CHART": + case 6: + message.visualizationTypes[i] = 6; + break; + case "LINE_CHART": + case 7: + message.visualizationTypes[i] = 7; + break; + case "AREA_CHART": + case 8: + message.visualizationTypes[i] = 8; + break; + case "COMBO_CHART": + case 9: + message.visualizationTypes[i] = 9; + break; + case "HISTOGRAM": + case 10: + message.visualizationTypes[i] = 10; + break; + case "GENERIC_CHART": + case 11: + message.visualizationTypes[i] = 11; + break; + case "CHART_NOT_UNDERSTOOD": + case 12: + message.visualizationTypes[i] = 12; + break; + } + } + if (object.columnInfo) { + if (!Array.isArray(object.columnInfo)) + throw TypeError(".google.cloud.dataqna.v1alpha.InterpretationStructure.columnInfo: array expected"); + message.columnInfo = []; + for (var i = 0; i < object.columnInfo.length; ++i) { + if (typeof object.columnInfo[i] !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.InterpretationStructure.columnInfo: object expected"); + message.columnInfo[i] = $root.google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo.fromObject(object.columnInfo[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InterpretationStructure message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretationStructure} message InterpretationStructure + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterpretationStructure.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.visualizationTypes = []; + object.columnInfo = []; + } + if (message.visualizationTypes && message.visualizationTypes.length) { + object.visualizationTypes = []; + for (var j = 0; j < message.visualizationTypes.length; ++j) + object.visualizationTypes[j] = options.enums === String ? $root.google.cloud.dataqna.v1alpha.InterpretationStructure.VisualizationType[message.visualizationTypes[j]] : message.visualizationTypes[j]; + } + if (message.columnInfo && message.columnInfo.length) { + object.columnInfo = []; + for (var j = 0; j < message.columnInfo.length; ++j) + object.columnInfo[j] = $root.google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo.toObject(message.columnInfo[j], options); + } + return object; + }; + + /** + * Converts this InterpretationStructure to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @instance + * @returns {Object.} JSON object + */ + InterpretationStructure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + InterpretationStructure.ColumnInfo = (function() { + + /** + * Properties of a ColumnInfo. + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @interface IColumnInfo + * @property {string|null} [outputAlias] ColumnInfo outputAlias + * @property {string|null} [displayName] ColumnInfo displayName + */ + + /** + * Constructs a new ColumnInfo. + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @classdesc Represents a ColumnInfo. + * @implements IColumnInfo + * @constructor + * @param {google.cloud.dataqna.v1alpha.InterpretationStructure.IColumnInfo=} [properties] Properties to set + */ + function ColumnInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnInfo outputAlias. + * @member {string} outputAlias + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @instance + */ + ColumnInfo.prototype.outputAlias = ""; + + /** + * ColumnInfo displayName. + * @member {string} displayName + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @instance + */ + ColumnInfo.prototype.displayName = ""; + + /** + * Creates a new ColumnInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretationStructure.IColumnInfo=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo} ColumnInfo instance + */ + ColumnInfo.create = function create(properties) { + return new ColumnInfo(properties); + }; + + /** + * Encodes the specified ColumnInfo message. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretationStructure.IColumnInfo} message ColumnInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputAlias != null && Object.hasOwnProperty.call(message, "outputAlias")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputAlias); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ColumnInfo message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretationStructure.IColumnInfo} message ColumnInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo} ColumnInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputAlias = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo} ColumnInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnInfo message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputAlias != null && message.hasOwnProperty("outputAlias")) + if (!$util.isString(message.outputAlias)) + return "outputAlias: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a ColumnInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo} ColumnInfo + */ + ColumnInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo(); + if (object.outputAlias != null) + message.outputAlias = String(object.outputAlias); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a ColumnInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @static + * @param {google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo} message ColumnInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.outputAlias = ""; + object.displayName = ""; + } + if (message.outputAlias != null && message.hasOwnProperty("outputAlias")) + object.outputAlias = message.outputAlias; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ColumnInfo to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @instance + * @returns {Object.} JSON object + */ + ColumnInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ColumnInfo; + })(); + + /** + * VisualizationType enum. + * @name google.cloud.dataqna.v1alpha.InterpretationStructure.VisualizationType + * @enum {number} + * @property {number} VISUALIZATION_TYPE_UNSPECIFIED=0 VISUALIZATION_TYPE_UNSPECIFIED value + * @property {number} TABLE=1 TABLE value + * @property {number} BAR_CHART=2 BAR_CHART value + * @property {number} COLUMN_CHART=3 COLUMN_CHART value + * @property {number} TIMELINE=4 TIMELINE value + * @property {number} SCATTER_PLOT=5 SCATTER_PLOT value + * @property {number} PIE_CHART=6 PIE_CHART value + * @property {number} LINE_CHART=7 LINE_CHART value + * @property {number} AREA_CHART=8 AREA_CHART value + * @property {number} COMBO_CHART=9 COMBO_CHART value + * @property {number} HISTOGRAM=10 HISTOGRAM value + * @property {number} GENERIC_CHART=11 GENERIC_CHART value + * @property {number} CHART_NOT_UNDERSTOOD=12 CHART_NOT_UNDERSTOOD value + */ + InterpretationStructure.VisualizationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISUALIZATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TABLE"] = 1; + values[valuesById[2] = "BAR_CHART"] = 2; + values[valuesById[3] = "COLUMN_CHART"] = 3; + values[valuesById[4] = "TIMELINE"] = 4; + values[valuesById[5] = "SCATTER_PLOT"] = 5; + values[valuesById[6] = "PIE_CHART"] = 6; + values[valuesById[7] = "LINE_CHART"] = 7; + values[valuesById[8] = "AREA_CHART"] = 8; + values[valuesById[9] = "COMBO_CHART"] = 9; + values[valuesById[10] = "HISTOGRAM"] = 10; + values[valuesById[11] = "GENERIC_CHART"] = 11; + values[valuesById[12] = "CHART_NOT_UNDERSTOOD"] = 12; + return values; + })(); + + return InterpretationStructure; + })(); + + v1alpha.DebugFlags = (function() { + + /** + * Properties of a DebugFlags. + * @memberof google.cloud.dataqna.v1alpha + * @interface IDebugFlags + * @property {boolean|null} [includeVaQuery] DebugFlags includeVaQuery + * @property {boolean|null} [includeNestedVaQuery] DebugFlags includeNestedVaQuery + * @property {boolean|null} [includeHumanInterpretation] DebugFlags includeHumanInterpretation + * @property {boolean|null} [includeAquaDebugResponse] DebugFlags includeAquaDebugResponse + * @property {number|Long|null} [timeOverride] DebugFlags timeOverride + * @property {boolean|null} [isInternalGoogleUser] DebugFlags isInternalGoogleUser + * @property {boolean|null} [ignoreCache] DebugFlags ignoreCache + * @property {boolean|null} [includeSearchEntitiesRpc] DebugFlags includeSearchEntitiesRpc + * @property {boolean|null} [includeListColumnAnnotationsRpc] DebugFlags includeListColumnAnnotationsRpc + * @property {boolean|null} [includeVirtualAnalystEntities] DebugFlags includeVirtualAnalystEntities + * @property {boolean|null} [includeTableList] DebugFlags includeTableList + * @property {boolean|null} [includeDomainList] DebugFlags includeDomainList + */ + + /** + * Constructs a new DebugFlags. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a DebugFlags. + * @implements IDebugFlags + * @constructor + * @param {google.cloud.dataqna.v1alpha.IDebugFlags=} [properties] Properties to set + */ + function DebugFlags(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DebugFlags includeVaQuery. + * @member {boolean} includeVaQuery + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.includeVaQuery = false; + + /** + * DebugFlags includeNestedVaQuery. + * @member {boolean} includeNestedVaQuery + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.includeNestedVaQuery = false; + + /** + * DebugFlags includeHumanInterpretation. + * @member {boolean} includeHumanInterpretation + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.includeHumanInterpretation = false; + + /** + * DebugFlags includeAquaDebugResponse. + * @member {boolean} includeAquaDebugResponse + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.includeAquaDebugResponse = false; + + /** + * DebugFlags timeOverride. + * @member {number|Long} timeOverride + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.timeOverride = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DebugFlags isInternalGoogleUser. + * @member {boolean} isInternalGoogleUser + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.isInternalGoogleUser = false; + + /** + * DebugFlags ignoreCache. + * @member {boolean} ignoreCache + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.ignoreCache = false; + + /** + * DebugFlags includeSearchEntitiesRpc. + * @member {boolean} includeSearchEntitiesRpc + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.includeSearchEntitiesRpc = false; + + /** + * DebugFlags includeListColumnAnnotationsRpc. + * @member {boolean} includeListColumnAnnotationsRpc + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.includeListColumnAnnotationsRpc = false; + + /** + * DebugFlags includeVirtualAnalystEntities. + * @member {boolean} includeVirtualAnalystEntities + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.includeVirtualAnalystEntities = false; + + /** + * DebugFlags includeTableList. + * @member {boolean} includeTableList + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.includeTableList = false; + + /** + * DebugFlags includeDomainList. + * @member {boolean} includeDomainList + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + */ + DebugFlags.prototype.includeDomainList = false; + + /** + * Creates a new DebugFlags instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @static + * @param {google.cloud.dataqna.v1alpha.IDebugFlags=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.DebugFlags} DebugFlags instance + */ + DebugFlags.create = function create(properties) { + return new DebugFlags(properties); + }; + + /** + * Encodes the specified DebugFlags message. Does not implicitly {@link google.cloud.dataqna.v1alpha.DebugFlags.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @static + * @param {google.cloud.dataqna.v1alpha.IDebugFlags} message DebugFlags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DebugFlags.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includeVaQuery != null && Object.hasOwnProperty.call(message, "includeVaQuery")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.includeVaQuery); + if (message.includeNestedVaQuery != null && Object.hasOwnProperty.call(message, "includeNestedVaQuery")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeNestedVaQuery); + if (message.includeHumanInterpretation != null && Object.hasOwnProperty.call(message, "includeHumanInterpretation")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.includeHumanInterpretation); + if (message.includeAquaDebugResponse != null && Object.hasOwnProperty.call(message, "includeAquaDebugResponse")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.includeAquaDebugResponse); + if (message.timeOverride != null && Object.hasOwnProperty.call(message, "timeOverride")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.timeOverride); + if (message.isInternalGoogleUser != null && Object.hasOwnProperty.call(message, "isInternalGoogleUser")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isInternalGoogleUser); + if (message.ignoreCache != null && Object.hasOwnProperty.call(message, "ignoreCache")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreCache); + if (message.includeSearchEntitiesRpc != null && Object.hasOwnProperty.call(message, "includeSearchEntitiesRpc")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.includeSearchEntitiesRpc); + if (message.includeListColumnAnnotationsRpc != null && Object.hasOwnProperty.call(message, "includeListColumnAnnotationsRpc")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.includeListColumnAnnotationsRpc); + if (message.includeVirtualAnalystEntities != null && Object.hasOwnProperty.call(message, "includeVirtualAnalystEntities")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.includeVirtualAnalystEntities); + if (message.includeTableList != null && Object.hasOwnProperty.call(message, "includeTableList")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.includeTableList); + if (message.includeDomainList != null && Object.hasOwnProperty.call(message, "includeDomainList")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.includeDomainList); + return writer; + }; + + /** + * Encodes the specified DebugFlags message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.DebugFlags.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @static + * @param {google.cloud.dataqna.v1alpha.IDebugFlags} message DebugFlags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DebugFlags.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DebugFlags message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.DebugFlags} DebugFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DebugFlags.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.DebugFlags(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.includeVaQuery = reader.bool(); + break; + case 2: + message.includeNestedVaQuery = reader.bool(); + break; + case 3: + message.includeHumanInterpretation = reader.bool(); + break; + case 4: + message.includeAquaDebugResponse = reader.bool(); + break; + case 5: + message.timeOverride = reader.int64(); + break; + case 6: + message.isInternalGoogleUser = reader.bool(); + break; + case 7: + message.ignoreCache = reader.bool(); + break; + case 8: + message.includeSearchEntitiesRpc = reader.bool(); + break; + case 9: + message.includeListColumnAnnotationsRpc = reader.bool(); + break; + case 10: + message.includeVirtualAnalystEntities = reader.bool(); + break; + case 11: + message.includeTableList = reader.bool(); + break; + case 12: + message.includeDomainList = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DebugFlags message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.DebugFlags} DebugFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DebugFlags.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DebugFlags message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DebugFlags.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.includeVaQuery != null && message.hasOwnProperty("includeVaQuery")) + if (typeof message.includeVaQuery !== "boolean") + return "includeVaQuery: boolean expected"; + if (message.includeNestedVaQuery != null && message.hasOwnProperty("includeNestedVaQuery")) + if (typeof message.includeNestedVaQuery !== "boolean") + return "includeNestedVaQuery: boolean expected"; + if (message.includeHumanInterpretation != null && message.hasOwnProperty("includeHumanInterpretation")) + if (typeof message.includeHumanInterpretation !== "boolean") + return "includeHumanInterpretation: boolean expected"; + if (message.includeAquaDebugResponse != null && message.hasOwnProperty("includeAquaDebugResponse")) + if (typeof message.includeAquaDebugResponse !== "boolean") + return "includeAquaDebugResponse: boolean expected"; + if (message.timeOverride != null && message.hasOwnProperty("timeOverride")) + if (!$util.isInteger(message.timeOverride) && !(message.timeOverride && $util.isInteger(message.timeOverride.low) && $util.isInteger(message.timeOverride.high))) + return "timeOverride: integer|Long expected"; + if (message.isInternalGoogleUser != null && message.hasOwnProperty("isInternalGoogleUser")) + if (typeof message.isInternalGoogleUser !== "boolean") + return "isInternalGoogleUser: boolean expected"; + if (message.ignoreCache != null && message.hasOwnProperty("ignoreCache")) + if (typeof message.ignoreCache !== "boolean") + return "ignoreCache: boolean expected"; + if (message.includeSearchEntitiesRpc != null && message.hasOwnProperty("includeSearchEntitiesRpc")) + if (typeof message.includeSearchEntitiesRpc !== "boolean") + return "includeSearchEntitiesRpc: boolean expected"; + if (message.includeListColumnAnnotationsRpc != null && message.hasOwnProperty("includeListColumnAnnotationsRpc")) + if (typeof message.includeListColumnAnnotationsRpc !== "boolean") + return "includeListColumnAnnotationsRpc: boolean expected"; + if (message.includeVirtualAnalystEntities != null && message.hasOwnProperty("includeVirtualAnalystEntities")) + if (typeof message.includeVirtualAnalystEntities !== "boolean") + return "includeVirtualAnalystEntities: boolean expected"; + if (message.includeTableList != null && message.hasOwnProperty("includeTableList")) + if (typeof message.includeTableList !== "boolean") + return "includeTableList: boolean expected"; + if (message.includeDomainList != null && message.hasOwnProperty("includeDomainList")) + if (typeof message.includeDomainList !== "boolean") + return "includeDomainList: boolean expected"; + return null; + }; + + /** + * Creates a DebugFlags message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.DebugFlags} DebugFlags + */ + DebugFlags.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.DebugFlags) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.DebugFlags(); + if (object.includeVaQuery != null) + message.includeVaQuery = Boolean(object.includeVaQuery); + if (object.includeNestedVaQuery != null) + message.includeNestedVaQuery = Boolean(object.includeNestedVaQuery); + if (object.includeHumanInterpretation != null) + message.includeHumanInterpretation = Boolean(object.includeHumanInterpretation); + if (object.includeAquaDebugResponse != null) + message.includeAquaDebugResponse = Boolean(object.includeAquaDebugResponse); + if (object.timeOverride != null) + if ($util.Long) + (message.timeOverride = $util.Long.fromValue(object.timeOverride)).unsigned = false; + else if (typeof object.timeOverride === "string") + message.timeOverride = parseInt(object.timeOverride, 10); + else if (typeof object.timeOverride === "number") + message.timeOverride = object.timeOverride; + else if (typeof object.timeOverride === "object") + message.timeOverride = new $util.LongBits(object.timeOverride.low >>> 0, object.timeOverride.high >>> 0).toNumber(); + if (object.isInternalGoogleUser != null) + message.isInternalGoogleUser = Boolean(object.isInternalGoogleUser); + if (object.ignoreCache != null) + message.ignoreCache = Boolean(object.ignoreCache); + if (object.includeSearchEntitiesRpc != null) + message.includeSearchEntitiesRpc = Boolean(object.includeSearchEntitiesRpc); + if (object.includeListColumnAnnotationsRpc != null) + message.includeListColumnAnnotationsRpc = Boolean(object.includeListColumnAnnotationsRpc); + if (object.includeVirtualAnalystEntities != null) + message.includeVirtualAnalystEntities = Boolean(object.includeVirtualAnalystEntities); + if (object.includeTableList != null) + message.includeTableList = Boolean(object.includeTableList); + if (object.includeDomainList != null) + message.includeDomainList = Boolean(object.includeDomainList); + return message; + }; + + /** + * Creates a plain object from a DebugFlags message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @static + * @param {google.cloud.dataqna.v1alpha.DebugFlags} message DebugFlags + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DebugFlags.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.includeVaQuery = false; + object.includeNestedVaQuery = false; + object.includeHumanInterpretation = false; + object.includeAquaDebugResponse = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timeOverride = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeOverride = options.longs === String ? "0" : 0; + object.isInternalGoogleUser = false; + object.ignoreCache = false; + object.includeSearchEntitiesRpc = false; + object.includeListColumnAnnotationsRpc = false; + object.includeVirtualAnalystEntities = false; + object.includeTableList = false; + object.includeDomainList = false; + } + if (message.includeVaQuery != null && message.hasOwnProperty("includeVaQuery")) + object.includeVaQuery = message.includeVaQuery; + if (message.includeNestedVaQuery != null && message.hasOwnProperty("includeNestedVaQuery")) + object.includeNestedVaQuery = message.includeNestedVaQuery; + if (message.includeHumanInterpretation != null && message.hasOwnProperty("includeHumanInterpretation")) + object.includeHumanInterpretation = message.includeHumanInterpretation; + if (message.includeAquaDebugResponse != null && message.hasOwnProperty("includeAquaDebugResponse")) + object.includeAquaDebugResponse = message.includeAquaDebugResponse; + if (message.timeOverride != null && message.hasOwnProperty("timeOverride")) + if (typeof message.timeOverride === "number") + object.timeOverride = options.longs === String ? String(message.timeOverride) : message.timeOverride; + else + object.timeOverride = options.longs === String ? $util.Long.prototype.toString.call(message.timeOverride) : options.longs === Number ? new $util.LongBits(message.timeOverride.low >>> 0, message.timeOverride.high >>> 0).toNumber() : message.timeOverride; + if (message.isInternalGoogleUser != null && message.hasOwnProperty("isInternalGoogleUser")) + object.isInternalGoogleUser = message.isInternalGoogleUser; + if (message.ignoreCache != null && message.hasOwnProperty("ignoreCache")) + object.ignoreCache = message.ignoreCache; + if (message.includeSearchEntitiesRpc != null && message.hasOwnProperty("includeSearchEntitiesRpc")) + object.includeSearchEntitiesRpc = message.includeSearchEntitiesRpc; + if (message.includeListColumnAnnotationsRpc != null && message.hasOwnProperty("includeListColumnAnnotationsRpc")) + object.includeListColumnAnnotationsRpc = message.includeListColumnAnnotationsRpc; + if (message.includeVirtualAnalystEntities != null && message.hasOwnProperty("includeVirtualAnalystEntities")) + object.includeVirtualAnalystEntities = message.includeVirtualAnalystEntities; + if (message.includeTableList != null && message.hasOwnProperty("includeTableList")) + object.includeTableList = message.includeTableList; + if (message.includeDomainList != null && message.hasOwnProperty("includeDomainList")) + object.includeDomainList = message.includeDomainList; + return object; + }; + + /** + * Converts this DebugFlags to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @instance + * @returns {Object.} JSON object + */ + DebugFlags.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DebugFlags; + })(); + + /** + * InterpretEntity enum. + * @name google.cloud.dataqna.v1alpha.InterpretEntity + * @enum {number} + * @property {number} INTERPRET_ENTITY_UNSPECIFIED=0 INTERPRET_ENTITY_UNSPECIFIED value + * @property {number} DIMENSION=1 DIMENSION value + * @property {number} METRIC=2 METRIC value + */ + v1alpha.InterpretEntity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERPRET_ENTITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIMENSION"] = 1; + values[valuesById[2] = "METRIC"] = 2; + return values; + })(); + + v1alpha.QuestionService = (function() { + + /** + * Constructs a new QuestionService service. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a QuestionService + * @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 QuestionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (QuestionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = QuestionService; + + /** + * Creates new QuestionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @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 {QuestionService} RPC service. Useful where requests and/or responses are streamed. + */ + QuestionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#getQuestion}. + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @typedef GetQuestionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataqna.v1alpha.Question} [response] Question + */ + + /** + * Calls GetQuestion. + * @function getQuestion + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.IGetQuestionRequest} request GetQuestionRequest message or plain object + * @param {google.cloud.dataqna.v1alpha.QuestionService.GetQuestionCallback} callback Node-style callback called with the error, if any, and Question + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(QuestionService.prototype.getQuestion = function getQuestion(request, callback) { + return this.rpcCall(getQuestion, $root.google.cloud.dataqna.v1alpha.GetQuestionRequest, $root.google.cloud.dataqna.v1alpha.Question, request, callback); + }, "name", { value: "GetQuestion" }); + + /** + * Calls GetQuestion. + * @function getQuestion + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.IGetQuestionRequest} request GetQuestionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#createQuestion}. + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @typedef CreateQuestionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataqna.v1alpha.Question} [response] Question + */ + + /** + * Calls CreateQuestion. + * @function createQuestion + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.ICreateQuestionRequest} request CreateQuestionRequest message or plain object + * @param {google.cloud.dataqna.v1alpha.QuestionService.CreateQuestionCallback} callback Node-style callback called with the error, if any, and Question + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(QuestionService.prototype.createQuestion = function createQuestion(request, callback) { + return this.rpcCall(createQuestion, $root.google.cloud.dataqna.v1alpha.CreateQuestionRequest, $root.google.cloud.dataqna.v1alpha.Question, request, callback); + }, "name", { value: "CreateQuestion" }); + + /** + * Calls CreateQuestion. + * @function createQuestion + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.ICreateQuestionRequest} request CreateQuestionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#executeQuestion}. + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @typedef ExecuteQuestionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataqna.v1alpha.Question} [response] Question + */ + + /** + * Calls ExecuteQuestion. + * @function executeQuestion + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.IExecuteQuestionRequest} request ExecuteQuestionRequest message or plain object + * @param {google.cloud.dataqna.v1alpha.QuestionService.ExecuteQuestionCallback} callback Node-style callback called with the error, if any, and Question + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(QuestionService.prototype.executeQuestion = function executeQuestion(request, callback) { + return this.rpcCall(executeQuestion, $root.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest, $root.google.cloud.dataqna.v1alpha.Question, request, callback); + }, "name", { value: "ExecuteQuestion" }); + + /** + * Calls ExecuteQuestion. + * @function executeQuestion + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.IExecuteQuestionRequest} request ExecuteQuestionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#getUserFeedback}. + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @typedef GetUserFeedbackCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataqna.v1alpha.UserFeedback} [response] UserFeedback + */ + + /** + * Calls GetUserFeedback. + * @function getUserFeedback + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest} request GetUserFeedbackRequest message or plain object + * @param {google.cloud.dataqna.v1alpha.QuestionService.GetUserFeedbackCallback} callback Node-style callback called with the error, if any, and UserFeedback + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(QuestionService.prototype.getUserFeedback = function getUserFeedback(request, callback) { + return this.rpcCall(getUserFeedback, $root.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest, $root.google.cloud.dataqna.v1alpha.UserFeedback, request, callback); + }, "name", { value: "GetUserFeedback" }); + + /** + * Calls GetUserFeedback. + * @function getUserFeedback + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest} request GetUserFeedbackRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#updateUserFeedback}. + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @typedef UpdateUserFeedbackCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataqna.v1alpha.UserFeedback} [response] UserFeedback + */ + + /** + * Calls UpdateUserFeedback. + * @function updateUserFeedback + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest} request UpdateUserFeedbackRequest message or plain object + * @param {google.cloud.dataqna.v1alpha.QuestionService.UpdateUserFeedbackCallback} callback Node-style callback called with the error, if any, and UserFeedback + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(QuestionService.prototype.updateUserFeedback = function updateUserFeedback(request, callback) { + return this.rpcCall(updateUserFeedback, $root.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest, $root.google.cloud.dataqna.v1alpha.UserFeedback, request, callback); + }, "name", { value: "UpdateUserFeedback" }); + + /** + * Calls UpdateUserFeedback. + * @function updateUserFeedback + * @memberof google.cloud.dataqna.v1alpha.QuestionService + * @instance + * @param {google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest} request UpdateUserFeedbackRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return QuestionService; + })(); + + v1alpha.GetQuestionRequest = (function() { + + /** + * Properties of a GetQuestionRequest. + * @memberof google.cloud.dataqna.v1alpha + * @interface IGetQuestionRequest + * @property {string|null} [name] GetQuestionRequest name + * @property {google.protobuf.IFieldMask|null} [readMask] GetQuestionRequest readMask + */ + + /** + * Constructs a new GetQuestionRequest. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a GetQuestionRequest. + * @implements IGetQuestionRequest + * @constructor + * @param {google.cloud.dataqna.v1alpha.IGetQuestionRequest=} [properties] Properties to set + */ + function GetQuestionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetQuestionRequest name. + * @member {string} name + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @instance + */ + GetQuestionRequest.prototype.name = ""; + + /** + * GetQuestionRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @instance + */ + GetQuestionRequest.prototype.readMask = null; + + /** + * Creates a new GetQuestionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IGetQuestionRequest=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.GetQuestionRequest} GetQuestionRequest instance + */ + GetQuestionRequest.create = function create(properties) { + return new GetQuestionRequest(properties); + }; + + /** + * Encodes the specified GetQuestionRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.GetQuestionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IGetQuestionRequest} message GetQuestionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQuestionRequest.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.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetQuestionRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.GetQuestionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IGetQuestionRequest} message GetQuestionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQuestionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetQuestionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.GetQuestionRequest} GetQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQuestionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.GetQuestionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetQuestionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.GetQuestionRequest} GetQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQuestionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetQuestionRequest message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetQuestionRequest.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.readMask != null && message.hasOwnProperty("readMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + return null; + }; + + /** + * Creates a GetQuestionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.GetQuestionRequest} GetQuestionRequest + */ + GetQuestionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.GetQuestionRequest) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.GetQuestionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.GetQuestionRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + return message; + }; + + /** + * Creates a plain object from a GetQuestionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.GetQuestionRequest} message GetQuestionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetQuestionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.readMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.readMask != null && message.hasOwnProperty("readMask")) + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + return object; + }; + + /** + * Converts this GetQuestionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @instance + * @returns {Object.} JSON object + */ + GetQuestionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetQuestionRequest; + })(); + + v1alpha.CreateQuestionRequest = (function() { + + /** + * Properties of a CreateQuestionRequest. + * @memberof google.cloud.dataqna.v1alpha + * @interface ICreateQuestionRequest + * @property {string|null} [parent] CreateQuestionRequest parent + * @property {google.cloud.dataqna.v1alpha.IQuestion|null} [question] CreateQuestionRequest question + */ + + /** + * Constructs a new CreateQuestionRequest. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a CreateQuestionRequest. + * @implements ICreateQuestionRequest + * @constructor + * @param {google.cloud.dataqna.v1alpha.ICreateQuestionRequest=} [properties] Properties to set + */ + function CreateQuestionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateQuestionRequest parent. + * @member {string} parent + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @instance + */ + CreateQuestionRequest.prototype.parent = ""; + + /** + * CreateQuestionRequest question. + * @member {google.cloud.dataqna.v1alpha.IQuestion|null|undefined} question + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @instance + */ + CreateQuestionRequest.prototype.question = null; + + /** + * Creates a new CreateQuestionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.ICreateQuestionRequest=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.CreateQuestionRequest} CreateQuestionRequest instance + */ + CreateQuestionRequest.create = function create(properties) { + return new CreateQuestionRequest(properties); + }; + + /** + * Encodes the specified CreateQuestionRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.CreateQuestionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.ICreateQuestionRequest} message CreateQuestionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateQuestionRequest.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.question != null && Object.hasOwnProperty.call(message, "question")) + $root.google.cloud.dataqna.v1alpha.Question.encode(message.question, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateQuestionRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.CreateQuestionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.ICreateQuestionRequest} message CreateQuestionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateQuestionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateQuestionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.CreateQuestionRequest} CreateQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateQuestionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.CreateQuestionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.question = $root.google.cloud.dataqna.v1alpha.Question.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateQuestionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.CreateQuestionRequest} CreateQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateQuestionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateQuestionRequest message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateQuestionRequest.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.question != null && message.hasOwnProperty("question")) { + var error = $root.google.cloud.dataqna.v1alpha.Question.verify(message.question); + if (error) + return "question." + error; + } + return null; + }; + + /** + * Creates a CreateQuestionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.CreateQuestionRequest} CreateQuestionRequest + */ + CreateQuestionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.CreateQuestionRequest) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.CreateQuestionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.question != null) { + if (typeof object.question !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.CreateQuestionRequest.question: object expected"); + message.question = $root.google.cloud.dataqna.v1alpha.Question.fromObject(object.question); + } + return message; + }; + + /** + * Creates a plain object from a CreateQuestionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.CreateQuestionRequest} message CreateQuestionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateQuestionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.question = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.question != null && message.hasOwnProperty("question")) + object.question = $root.google.cloud.dataqna.v1alpha.Question.toObject(message.question, options); + return object; + }; + + /** + * Converts this CreateQuestionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateQuestionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateQuestionRequest; + })(); + + v1alpha.ExecuteQuestionRequest = (function() { + + /** + * Properties of an ExecuteQuestionRequest. + * @memberof google.cloud.dataqna.v1alpha + * @interface IExecuteQuestionRequest + * @property {string|null} [name] ExecuteQuestionRequest name + * @property {number|null} [interpretationIndex] ExecuteQuestionRequest interpretationIndex + */ + + /** + * Constructs a new ExecuteQuestionRequest. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents an ExecuteQuestionRequest. + * @implements IExecuteQuestionRequest + * @constructor + * @param {google.cloud.dataqna.v1alpha.IExecuteQuestionRequest=} [properties] Properties to set + */ + function ExecuteQuestionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteQuestionRequest name. + * @member {string} name + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @instance + */ + ExecuteQuestionRequest.prototype.name = ""; + + /** + * ExecuteQuestionRequest interpretationIndex. + * @member {number} interpretationIndex + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @instance + */ + ExecuteQuestionRequest.prototype.interpretationIndex = 0; + + /** + * Creates a new ExecuteQuestionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IExecuteQuestionRequest=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.ExecuteQuestionRequest} ExecuteQuestionRequest instance + */ + ExecuteQuestionRequest.create = function create(properties) { + return new ExecuteQuestionRequest(properties); + }; + + /** + * Encodes the specified ExecuteQuestionRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.ExecuteQuestionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IExecuteQuestionRequest} message ExecuteQuestionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQuestionRequest.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.interpretationIndex != null && Object.hasOwnProperty.call(message, "interpretationIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.interpretationIndex); + return writer; + }; + + /** + * Encodes the specified ExecuteQuestionRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.ExecuteQuestionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IExecuteQuestionRequest} message ExecuteQuestionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteQuestionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteQuestionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.ExecuteQuestionRequest} ExecuteQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQuestionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.interpretationIndex = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteQuestionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.ExecuteQuestionRequest} ExecuteQuestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteQuestionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteQuestionRequest message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteQuestionRequest.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.interpretationIndex != null && message.hasOwnProperty("interpretationIndex")) + if (!$util.isInteger(message.interpretationIndex)) + return "interpretationIndex: integer expected"; + return null; + }; + + /** + * Creates an ExecuteQuestionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.ExecuteQuestionRequest} ExecuteQuestionRequest + */ + ExecuteQuestionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.interpretationIndex != null) + message.interpretationIndex = object.interpretationIndex | 0; + return message; + }; + + /** + * Creates a plain object from an ExecuteQuestionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @static + * @param {google.cloud.dataqna.v1alpha.ExecuteQuestionRequest} message ExecuteQuestionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteQuestionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.interpretationIndex = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.interpretationIndex != null && message.hasOwnProperty("interpretationIndex")) + object.interpretationIndex = message.interpretationIndex; + return object; + }; + + /** + * Converts this ExecuteQuestionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteQuestionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExecuteQuestionRequest; + })(); + + v1alpha.GetUserFeedbackRequest = (function() { + + /** + * Properties of a GetUserFeedbackRequest. + * @memberof google.cloud.dataqna.v1alpha + * @interface IGetUserFeedbackRequest + * @property {string|null} [name] GetUserFeedbackRequest name + */ + + /** + * Constructs a new GetUserFeedbackRequest. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a GetUserFeedbackRequest. + * @implements IGetUserFeedbackRequest + * @constructor + * @param {google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest=} [properties] Properties to set + */ + function GetUserFeedbackRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetUserFeedbackRequest name. + * @member {string} name + * @memberof google.cloud.dataqna.v1alpha.GetUserFeedbackRequest + * @instance + */ + GetUserFeedbackRequest.prototype.name = ""; + + /** + * Creates a new GetUserFeedbackRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.GetUserFeedbackRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.GetUserFeedbackRequest} GetUserFeedbackRequest instance + */ + GetUserFeedbackRequest.create = function create(properties) { + return new GetUserFeedbackRequest(properties); + }; + + /** + * Encodes the specified GetUserFeedbackRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.GetUserFeedbackRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.GetUserFeedbackRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest} message GetUserFeedbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserFeedbackRequest.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 GetUserFeedbackRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.GetUserFeedbackRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.GetUserFeedbackRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest} message GetUserFeedbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserFeedbackRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetUserFeedbackRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.GetUserFeedbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.GetUserFeedbackRequest} GetUserFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserFeedbackRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest(); + 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 GetUserFeedbackRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.GetUserFeedbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.GetUserFeedbackRequest} GetUserFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserFeedbackRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUserFeedbackRequest message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.GetUserFeedbackRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUserFeedbackRequest.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 GetUserFeedbackRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.GetUserFeedbackRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.GetUserFeedbackRequest} GetUserFeedbackRequest + */ + GetUserFeedbackRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetUserFeedbackRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.GetUserFeedbackRequest + * @static + * @param {google.cloud.dataqna.v1alpha.GetUserFeedbackRequest} message GetUserFeedbackRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUserFeedbackRequest.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 GetUserFeedbackRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.GetUserFeedbackRequest + * @instance + * @returns {Object.} JSON object + */ + GetUserFeedbackRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetUserFeedbackRequest; + })(); + + v1alpha.UpdateUserFeedbackRequest = (function() { + + /** + * Properties of an UpdateUserFeedbackRequest. + * @memberof google.cloud.dataqna.v1alpha + * @interface IUpdateUserFeedbackRequest + * @property {google.cloud.dataqna.v1alpha.IUserFeedback|null} [userFeedback] UpdateUserFeedbackRequest userFeedback + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserFeedbackRequest updateMask + */ + + /** + * Constructs a new UpdateUserFeedbackRequest. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents an UpdateUserFeedbackRequest. + * @implements IUpdateUserFeedbackRequest + * @constructor + * @param {google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest=} [properties] Properties to set + */ + function UpdateUserFeedbackRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateUserFeedbackRequest userFeedback. + * @member {google.cloud.dataqna.v1alpha.IUserFeedback|null|undefined} userFeedback + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @instance + */ + UpdateUserFeedbackRequest.prototype.userFeedback = null; + + /** + * UpdateUserFeedbackRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @instance + */ + UpdateUserFeedbackRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateUserFeedbackRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest} UpdateUserFeedbackRequest instance + */ + UpdateUserFeedbackRequest.create = function create(properties) { + return new UpdateUserFeedbackRequest(properties); + }; + + /** + * Encodes the specified UpdateUserFeedbackRequest message. Does not implicitly {@link google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest} message UpdateUserFeedbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserFeedbackRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userFeedback != null && Object.hasOwnProperty.call(message, "userFeedback")) + $root.google.cloud.dataqna.v1alpha.UserFeedback.encode(message.userFeedback, 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 UpdateUserFeedbackRequest message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @static + * @param {google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest} message UpdateUserFeedbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserFeedbackRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUserFeedbackRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest} UpdateUserFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserFeedbackRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userFeedback = $root.google.cloud.dataqna.v1alpha.UserFeedback.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 UpdateUserFeedbackRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest} UpdateUserFeedbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserFeedbackRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateUserFeedbackRequest message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUserFeedbackRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userFeedback != null && message.hasOwnProperty("userFeedback")) { + var error = $root.google.cloud.dataqna.v1alpha.UserFeedback.verify(message.userFeedback); + if (error) + return "userFeedback." + 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 UpdateUserFeedbackRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest} UpdateUserFeedbackRequest + */ + UpdateUserFeedbackRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest(); + if (object.userFeedback != null) { + if (typeof object.userFeedback !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest.userFeedback: object expected"); + message.userFeedback = $root.google.cloud.dataqna.v1alpha.UserFeedback.fromObject(object.userFeedback); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateUserFeedbackRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @static + * @param {google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest} message UpdateUserFeedbackRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUserFeedbackRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userFeedback = null; + object.updateMask = null; + } + if (message.userFeedback != null && message.hasOwnProperty("userFeedback")) + object.userFeedback = $root.google.cloud.dataqna.v1alpha.UserFeedback.toObject(message.userFeedback, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateUserFeedbackRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateUserFeedbackRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateUserFeedbackRequest; + })(); + + v1alpha.UserFeedback = (function() { + + /** + * Properties of a UserFeedback. + * @memberof google.cloud.dataqna.v1alpha + * @interface IUserFeedback + * @property {string|null} [name] UserFeedback name + * @property {string|null} [freeFormFeedback] UserFeedback freeFormFeedback + * @property {google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating|null} [rating] UserFeedback rating + */ + + /** + * Constructs a new UserFeedback. + * @memberof google.cloud.dataqna.v1alpha + * @classdesc Represents a UserFeedback. + * @implements IUserFeedback + * @constructor + * @param {google.cloud.dataqna.v1alpha.IUserFeedback=} [properties] Properties to set + */ + function UserFeedback(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserFeedback name. + * @member {string} name + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @instance + */ + UserFeedback.prototype.name = ""; + + /** + * UserFeedback freeFormFeedback. + * @member {string} freeFormFeedback + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @instance + */ + UserFeedback.prototype.freeFormFeedback = ""; + + /** + * UserFeedback rating. + * @member {google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating} rating + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @instance + */ + UserFeedback.prototype.rating = 0; + + /** + * Creates a new UserFeedback instance using the specified properties. + * @function create + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @static + * @param {google.cloud.dataqna.v1alpha.IUserFeedback=} [properties] Properties to set + * @returns {google.cloud.dataqna.v1alpha.UserFeedback} UserFeedback instance + */ + UserFeedback.create = function create(properties) { + return new UserFeedback(properties); + }; + + /** + * Encodes the specified UserFeedback message. Does not implicitly {@link google.cloud.dataqna.v1alpha.UserFeedback.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @static + * @param {google.cloud.dataqna.v1alpha.IUserFeedback} message UserFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserFeedback.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.freeFormFeedback != null && Object.hasOwnProperty.call(message, "freeFormFeedback")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.freeFormFeedback); + if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.rating); + return writer; + }; + + /** + * Encodes the specified UserFeedback message, length delimited. Does not implicitly {@link google.cloud.dataqna.v1alpha.UserFeedback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @static + * @param {google.cloud.dataqna.v1alpha.IUserFeedback} message UserFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserFeedback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserFeedback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataqna.v1alpha.UserFeedback} UserFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserFeedback.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataqna.v1alpha.UserFeedback(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.freeFormFeedback = reader.string(); + break; + case 3: + message.rating = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserFeedback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataqna.v1alpha.UserFeedback} UserFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserFeedback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserFeedback message. + * @function verify + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserFeedback.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.freeFormFeedback != null && message.hasOwnProperty("freeFormFeedback")) + if (!$util.isString(message.freeFormFeedback)) + return "freeFormFeedback: string expected"; + if (message.rating != null && message.hasOwnProperty("rating")) + switch (message.rating) { + default: + return "rating: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a UserFeedback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataqna.v1alpha.UserFeedback} UserFeedback + */ + UserFeedback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataqna.v1alpha.UserFeedback) + return object; + var message = new $root.google.cloud.dataqna.v1alpha.UserFeedback(); + if (object.name != null) + message.name = String(object.name); + if (object.freeFormFeedback != null) + message.freeFormFeedback = String(object.freeFormFeedback); + switch (object.rating) { + case "USER_FEEDBACK_RATING_UNSPECIFIED": + case 0: + message.rating = 0; + break; + case "POSITIVE": + case 1: + message.rating = 1; + break; + case "NEGATIVE": + case 2: + message.rating = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a UserFeedback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @static + * @param {google.cloud.dataqna.v1alpha.UserFeedback} message UserFeedback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserFeedback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.freeFormFeedback = ""; + object.rating = options.enums === String ? "USER_FEEDBACK_RATING_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.freeFormFeedback != null && message.hasOwnProperty("freeFormFeedback")) + object.freeFormFeedback = message.freeFormFeedback; + if (message.rating != null && message.hasOwnProperty("rating")) + object.rating = options.enums === String ? $root.google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating[message.rating] : message.rating; + return object; + }; + + /** + * Converts this UserFeedback to JSON. + * @function toJSON + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @instance + * @returns {Object.} JSON object + */ + UserFeedback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * UserFeedbackRating enum. + * @name google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating + * @enum {number} + * @property {number} USER_FEEDBACK_RATING_UNSPECIFIED=0 USER_FEEDBACK_RATING_UNSPECIFIED value + * @property {number} POSITIVE=1 POSITIVE value + * @property {number} NEGATIVE=2 NEGATIVE value + */ + UserFeedback.UserFeedbackRating = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_FEEDBACK_RATING_UNSPECIFIED"] = 0; + values[valuesById[1] = "POSITIVE"] = 1; + values[valuesById[2] = "NEGATIVE"] = 2; + return values; + })(); + + return UserFeedback; + })(); + + return v1alpha; + })(); + + return dataqna; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string} 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 && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + case 5: + message.plural = reader.string(); + break; + case 6: + message.singular = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32(); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1052: + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + 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 {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * 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 && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 72295728: + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + case 1051: + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + 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 {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + protobuf.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; + })(); + + return protobuf; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-dataqna/protos/protos.json b/packages/google-cloud-dataqna/protos/protos.json new file mode 100644 index 00000000000..827535fc39e --- /dev/null +++ b/packages/google-cloud-dataqna/protos/protos.json @@ -0,0 +1,1895 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "dataqna": { + "nested": { + "v1alpha": { + "options": { + "csharp_namespace": "Google.Cloud.DataQnA.V1Alpha", + "go_package": "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha;dataqna", + "java_multiple_files": true, + "java_outer_classname": "UserFeedbackProto", + "java_package": "com.google.cloud.dataqna.v1alpha", + "php_namespace": "Google\\Cloud\\DataQnA\\V1alpha", + "ruby_package": "Google::Cloud::DataQnA::V1alpha" + }, + "nested": { + "AnnotatedString": { + "fields": { + "textFormatted": { + "type": "string", + "id": 1 + }, + "htmlFormatted": { + "type": "string", + "id": 2 + }, + "markups": { + "rule": "repeated", + "type": "SemanticMarkup", + "id": 3 + } + }, + "nested": { + "SemanticMarkup": { + "fields": { + "type": { + "type": "SemanticMarkupType", + "id": 1 + }, + "startCharIndex": { + "type": "int32", + "id": 2 + }, + "length": { + "type": "int32", + "id": 3 + } + } + }, + "SemanticMarkupType": { + "values": { + "MARKUP_TYPE_UNSPECIFIED": 0, + "METRIC": 1, + "DIMENSION": 2, + "FILTER": 3, + "UNUSED": 4, + "BLOCKED": 5, + "ROW": 6 + } + } + } + }, + "AutoSuggestionService": { + "options": { + "(google.api.default_host)": "dataqna.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "SuggestQueries": { + "requestType": "SuggestQueriesRequest", + "responseType": "SuggestQueriesResponse", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}:suggestQueries", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}:suggestQueries", + "body": "*" + } + } + ] + } + } + }, + "SuggestQueriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "query": { + "type": "string", + "id": 3 + }, + "suggestionTypes": { + "rule": "repeated", + "type": "SuggestionType", + "id": 4 + } + } + }, + "Suggestion": { + "fields": { + "suggestionInfo": { + "type": "SuggestionInfo", + "id": 1 + }, + "rankingScore": { + "type": "double", + "id": 2 + }, + "suggestionType": { + "type": "SuggestionType", + "id": 3 + } + } + }, + "SuggestionInfo": { + "fields": { + "annotatedSuggestion": { + "type": "AnnotatedString", + "id": 1 + }, + "queryMatches": { + "rule": "repeated", + "type": "MatchInfo", + "id": 2 + } + }, + "nested": { + "MatchInfo": { + "fields": { + "startCharIndex": { + "type": "int32", + "id": 1 + }, + "length": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "SuggestQueriesResponse": { + "fields": { + "suggestions": { + "rule": "repeated", + "type": "Suggestion", + "id": 1 + } + } + }, + "SuggestionType": { + "values": { + "SUGGESTION_TYPE_UNSPECIFIED": 0, + "ENTITY": 1, + "TEMPLATE": 2 + } + }, + "Question": { + "options": { + "(google.api.resource).type": "dataqna.googleapis.com/Question", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/questions/{question}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "query": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "dataSourceAnnotations": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "interpretError": { + "type": "InterpretError", + "id": 5 + }, + "interpretations": { + "rule": "repeated", + "type": "Interpretation", + "id": 6 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "userEmail": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "debugFlags": { + "type": "DebugFlags", + "id": 9, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "debugInfo": { + "type": "google.protobuf.Any", + "id": 10 + } + } + }, + "InterpretError": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "code": { + "type": "InterpretErrorCode", + "id": 2 + }, + "details": { + "type": "InterpretErrorDetails", + "id": 3 + } + }, + "nested": { + "InterpretErrorDetails": { + "fields": { + "unsupportedDetails": { + "type": "InterpretUnsupportedDetails", + "id": 1 + }, + "incompleteQueryDetails": { + "type": "InterpretIncompleteQueryDetails", + "id": 2 + }, + "ambiguityDetails": { + "type": "InterpretAmbiguityDetails", + "id": 3 + } + } + }, + "InterpretUnsupportedDetails": { + "fields": { + "operators": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "intent": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "InterpretIncompleteQueryDetails": { + "fields": { + "entities": { + "rule": "repeated", + "type": "InterpretEntity", + "id": 1 + } + } + }, + "InterpretAmbiguityDetails": { + "fields": {} + }, + "InterpretErrorCode": { + "values": { + "INTERPRET_ERROR_CODE_UNSPECIFIED": 0, + "INVALID_QUERY": 1, + "FAILED_TO_UNDERSTAND": 2, + "FAILED_TO_ANSWER": 3 + } + } + } + }, + "ExecutionInfo": { + "fields": { + "jobCreationStatus": { + "type": "google.rpc.Status", + "id": 1 + }, + "jobExecutionState": { + "type": "JobExecutionState", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "bigqueryJob": { + "type": "BigQueryJob", + "id": 4 + } + }, + "nested": { + "JobExecutionState": { + "values": { + "JOB_EXECUTION_STATE_UNSPECIFIED": 0, + "NOT_EXECUTED": 1, + "RUNNING": 2, + "SUCCEEDED": 3, + "FAILED": 4 + } + } + } + }, + "BigQueryJob": { + "fields": { + "jobId": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "location": { + "type": "string", + "id": 3 + } + } + }, + "Interpretation": { + "fields": { + "dataSources": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "confidence": { + "type": "double", + "id": 2 + }, + "unusedPhrases": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "humanReadable": { + "type": "HumanReadable", + "id": 4 + }, + "interpretationStructure": { + "type": "InterpretationStructure", + "id": 5 + }, + "dataQuery": { + "type": "DataQuery", + "id": 6 + }, + "executionInfo": { + "type": "ExecutionInfo", + "id": 7 + } + } + }, + "DataQuery": { + "fields": { + "sql": { + "type": "string", + "id": 1 + } + } + }, + "HumanReadable": { + "fields": { + "generatedInterpretation": { + "type": "AnnotatedString", + "id": 1 + }, + "originalQuestion": { + "type": "AnnotatedString", + "id": 2 + } + } + }, + "InterpretationStructure": { + "fields": { + "visualizationTypes": { + "rule": "repeated", + "type": "VisualizationType", + "id": 1 + }, + "columnInfo": { + "rule": "repeated", + "type": "ColumnInfo", + "id": 2 + } + }, + "nested": { + "ColumnInfo": { + "fields": { + "outputAlias": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + } + } + }, + "VisualizationType": { + "values": { + "VISUALIZATION_TYPE_UNSPECIFIED": 0, + "TABLE": 1, + "BAR_CHART": 2, + "COLUMN_CHART": 3, + "TIMELINE": 4, + "SCATTER_PLOT": 5, + "PIE_CHART": 6, + "LINE_CHART": 7, + "AREA_CHART": 8, + "COMBO_CHART": 9, + "HISTOGRAM": 10, + "GENERIC_CHART": 11, + "CHART_NOT_UNDERSTOOD": 12 + } + } + } + }, + "DebugFlags": { + "fields": { + "includeVaQuery": { + "type": "bool", + "id": 1 + }, + "includeNestedVaQuery": { + "type": "bool", + "id": 2 + }, + "includeHumanInterpretation": { + "type": "bool", + "id": 3 + }, + "includeAquaDebugResponse": { + "type": "bool", + "id": 4 + }, + "timeOverride": { + "type": "int64", + "id": 5 + }, + "isInternalGoogleUser": { + "type": "bool", + "id": 6 + }, + "ignoreCache": { + "type": "bool", + "id": 7 + }, + "includeSearchEntitiesRpc": { + "type": "bool", + "id": 8 + }, + "includeListColumnAnnotationsRpc": { + "type": "bool", + "id": 9 + }, + "includeVirtualAnalystEntities": { + "type": "bool", + "id": 10 + }, + "includeTableList": { + "type": "bool", + "id": 11 + }, + "includeDomainList": { + "type": "bool", + "id": 12 + } + } + }, + "InterpretEntity": { + "values": { + "INTERPRET_ENTITY_UNSPECIFIED": 0, + "DIMENSION": 1, + "METRIC": 2 + } + }, + "QuestionService": { + "options": { + "(google.api.default_host)": "dataqna.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetQuestion": { + "requestType": "GetQuestionRequest", + "responseType": "Question", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/questions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/questions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateQuestion": { + "requestType": "CreateQuestionRequest", + "responseType": "Question", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/questions", + "(google.api.http).body": "question", + "(google.api.method_signature)": "parent,question" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}/questions", + "body": "question" + } + }, + { + "(google.api.method_signature)": "parent,question" + } + ] + }, + "ExecuteQuestion": { + "requestType": "ExecuteQuestionRequest", + "responseType": "Question", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/questions/*}:execute", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,interpretation_index" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/questions/*}:execute", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,interpretation_index" + } + ] + }, + "GetUserFeedback": { + "requestType": "GetUserFeedbackRequest", + "responseType": "UserFeedback", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/questions/*/userFeedback}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/questions/*/userFeedback}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateUserFeedback": { + "requestType": "UpdateUserFeedbackRequest", + "responseType": "UserFeedback", + "options": { + "(google.api.http).patch": "/v1alpha/{user_feedback.name=projects/*/locations/*/questions/*/userFeedback}", + "(google.api.http).body": "user_feedback", + "(google.api.method_signature)": "user_feedback,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{user_feedback.name=projects/*/locations/*/questions/*/userFeedback}", + "body": "user_feedback" + } + }, + { + "(google.api.method_signature)": "user_feedback,update_mask" + } + ] + } + } + }, + "GetQuestionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataqna.googleapis.com/Question" + } + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CreateQuestionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "question": { + "type": "Question", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExecuteQuestionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "interpretationIndex": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetUserFeedbackRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataqna.googleapis.com/UserFeedback" + } + } + } + }, + "UpdateUserFeedbackRequest": { + "fields": { + "userFeedback": { + "type": "UserFeedback", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UserFeedback": { + "options": { + "(google.api.resource).type": "dataqna.googleapis.com/UserFeedback", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/questions/{question}/userFeedback" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "freeFormFeedback": { + "type": "string", + "id": 2 + }, + "rating": { + "type": "UserFeedbackRating", + "id": 3 + } + }, + "nested": { + "UserFeedbackRating": { + "values": { + "USER_FEEDBACK_RATING_UNSPECIFIED": 0, + "POSITIVE": 1, + "NEGATIVE": 2 + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "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 + } + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "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" + } + } + }, + "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 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json new file mode 100644 index 00000000000..e1a2d08be0f --- /dev/null +++ b/packages/google-cloud-dataqna/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-data-qna", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=10" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/data-qna": "^0.1.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^7.1.0" + } +} diff --git a/packages/google-cloud-dataqna/samples/quickstart.js b/packages/google-cloud-dataqna/samples/quickstart.js new file mode 100644 index 00000000000..6865b268039 --- /dev/null +++ b/packages/google-cloud-dataqna/samples/quickstart.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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +'use strict'; + +async function main() { + async function quickstart() { + } + quickstart(); +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataqna/samples/test/quickstart.test.js b/packages/google-cloud-dataqna/samples/test/quickstart.test.js new file mode 100644 index 00000000000..55522cd4219 --- /dev/null +++ b/packages/google-cloud-dataqna/samples/test/quickstart.test.js @@ -0,0 +1,32 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const {assert} = require('chai'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const project = process.env.GCLOUD_PROJECT; + +describe('Quickstart', () => { + it('should run quickstart', async () => { + }); +}); diff --git a/packages/google-cloud-dataqna/src/index.ts b/packages/google-cloud-dataqna/src/index.ts new file mode 100644 index 00000000000..9bed8712a80 --- /dev/null +++ b/packages/google-cloud-dataqna/src/index.ts @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1alpha from './v1alpha'; + +const AutoSuggestionServiceClient = v1alpha.AutoSuggestionServiceClient; +type AutoSuggestionServiceClient = v1alpha.AutoSuggestionServiceClient; +const QuestionServiceClient = v1alpha.QuestionServiceClient; +type QuestionServiceClient = v1alpha.QuestionServiceClient; + +export {v1alpha, AutoSuggestionServiceClient, QuestionServiceClient}; +export default {v1alpha, AutoSuggestionServiceClient, QuestionServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts new file mode 100644 index 00000000000..cefdb3cd27a --- /dev/null +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -0,0 +1,631 @@ +// 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. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import * as path from 'path'; + +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/auto_suggestion_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './auto_suggestion_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * This stateless API provides automatic suggestions for natural language + * queries for the data sources in the provided project and location. + * + * The service provides a resourceless operation `suggestQueries` that can be + * called to get a list of suggestions for a given incomplete query and scope + * (or list of scopes) under which the query is to be interpreted. + * + * There are two types of suggestions, ENTITY for single entity suggestions + * and TEMPLATE for full sentences. By default, both types are returned. + * + * Example Request: + * ``` + * GetSuggestions({ + * parent: "locations/us/projects/my-project" + * scopes: + * "//bigquery.googleapis.com/projects/my-project/datasets/my-dataset/tables/my-table" + * query: "top it" + * }) + * ``` + * + * The service will retrieve information based on the given scope(s) and give + * suggestions based on that (e.g. "top item" for "top it" if "item" is a known + * dimension for the provided scope). + * ``` + * suggestions { + * suggestion_info { + * annotated_suggestion { + * text_formatted: "top item by sum of usd_revenue_net" + * markups { + * type: DIMENSION + * start_char_index: 4 + * length: 4 + * } + * markups { + * type: METRIC + * start_char_index: 19 + * length: 15 + * } + * } + * query_matches { + * start_char_index: 0 + * length: 6 + * } + * } + * suggestion_type: TEMPLATE + * ranking_score: 0.9 + * } + * suggestions { + * suggestion_info { + * annotated_suggestion { + * text_formatted: "item" + * markups { + * type: DIMENSION + * start_char_index: 4 + * length: 2 + * } + * } + * query_matches { + * start_char_index: 0 + * length: 6 + * } + * } + * suggestion_type: ENTITY + * ranking_score: 0.8 + * } + * ``` + * @class + * @memberof v1alpha + */ +export class AutoSuggestionServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + autoSuggestionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AutoSuggestionServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof AutoSuggestionServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + questionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/questions/{question}' + ), + userFeedbackPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/questions/{question}/userFeedback' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataqna.v1alpha.AutoSuggestionService', + 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.autoSuggestionServiceStub) { + return this.autoSuggestionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.dataqna.v1alpha.AutoSuggestionService. + this.autoSuggestionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dataqna.v1alpha.AutoSuggestionService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataqna.v1alpha + .AutoSuggestionService, + 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 autoSuggestionServiceStubMethods = ['suggestQueries']; + for (const methodName of autoSuggestionServiceStubMethods) { + const callPromise = this.autoSuggestionServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.autoSuggestionServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataqna.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dataqna.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + suggestQueries( + request: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest | undefined, + {} | undefined + ] + >; + suggestQueries( + request: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, + | protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + suggestQueries( + request: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, + | protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets a list of suggestions based on a prefix string. + * AutoSuggestion tolerance should be less than 1 second. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the suggestion query is the resource denoting the project and + * location. + * @param {string[]} request.scopes + * The scopes to which this search is restricted. The only supported scope + * pattern is + * `//bigquery.googleapis.com/projects/{GCP-PROJECT-ID}/datasets/{DATASET-ID}/tables/{TABLE-ID}`. + * @param {string} request.query + * User query for which to generate suggestions. If the query is empty, zero + * state suggestions are returned. This allows UIs to display suggestions + * right away, helping the user to get a sense of what a query might look + * like. + * @param {number[]} request.suggestionTypes + * The requested suggestion type. Multiple suggestion types can be + * requested, but there is no guarantee that the service will return + * suggestions for each type. Suggestions for a requested type might rank + * lower than suggestions for other types and the service may decide to cut + * these suggestions off. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SuggestQueriesResponse]{@link google.cloud.dataqna.v1alpha.SuggestQueriesResponse}. + * 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.suggestQueries(request); + */ + suggestQueries( + request: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, + | protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, + | protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest | 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.suggestQueries(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified question resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} question + * @returns {string} Resource name string. + */ + questionPath(project: string, location: string, question: string) { + return this.pathTemplates.questionPathTemplate.render({ + project: project, + location: location, + question: question, + }); + } + + /** + * Parse the project from Question resource. + * + * @param {string} questionName + * A fully-qualified path representing Question resource. + * @returns {string} A string representing the project. + */ + matchProjectFromQuestionName(questionName: string) { + return this.pathTemplates.questionPathTemplate.match(questionName).project; + } + + /** + * Parse the location from Question resource. + * + * @param {string} questionName + * A fully-qualified path representing Question resource. + * @returns {string} A string representing the location. + */ + matchLocationFromQuestionName(questionName: string) { + return this.pathTemplates.questionPathTemplate.match(questionName).location; + } + + /** + * Parse the question from Question resource. + * + * @param {string} questionName + * A fully-qualified path representing Question resource. + * @returns {string} A string representing the question. + */ + matchQuestionFromQuestionName(questionName: string) { + return this.pathTemplates.questionPathTemplate.match(questionName).question; + } + + /** + * Return a fully-qualified userFeedback resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} question + * @returns {string} Resource name string. + */ + userFeedbackPath(project: string, location: string, question: string) { + return this.pathTemplates.userFeedbackPathTemplate.render({ + project: project, + location: location, + question: question, + }); + } + + /** + * Parse the project from UserFeedback resource. + * + * @param {string} userFeedbackName + * A fully-qualified path representing UserFeedback resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUserFeedbackName(userFeedbackName: string) { + return this.pathTemplates.userFeedbackPathTemplate.match(userFeedbackName) + .project; + } + + /** + * Parse the location from UserFeedback resource. + * + * @param {string} userFeedbackName + * A fully-qualified path representing UserFeedback resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUserFeedbackName(userFeedbackName: string) { + return this.pathTemplates.userFeedbackPathTemplate.match(userFeedbackName) + .location; + } + + /** + * Parse the question from UserFeedback resource. + * + * @param {string} userFeedbackName + * A fully-qualified path representing UserFeedback resource. + * @returns {string} A string representing the question. + */ + matchQuestionFromUserFeedbackName(userFeedbackName: string) { + return this.pathTemplates.userFeedbackPathTemplate.match(userFeedbackName) + .question; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.autoSuggestionServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client_config.json b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client_config.json new file mode 100644 index 00000000000..c2159b2173e --- /dev/null +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.cloud.dataqna.v1alpha.AutoSuggestionService": { + "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": { + "SuggestQueries": { + "timeout_millis": 2000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_proto_list.json b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_proto_list.json new file mode 100644 index 00000000000..7411e879740 --- /dev/null +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_proto_list.json @@ -0,0 +1,7 @@ +[ + "../../protos/google/cloud/dataqna/v1alpha/annotated_string.proto", + "../../protos/google/cloud/dataqna/v1alpha/auto_suggestion_service.proto", + "../../protos/google/cloud/dataqna/v1alpha/question.proto", + "../../protos/google/cloud/dataqna/v1alpha/question_service.proto", + "../../protos/google/cloud/dataqna/v1alpha/user_feedback.proto" +] diff --git a/packages/google-cloud-dataqna/src/v1alpha/gapic_metadata.json b/packages/google-cloud-dataqna/src/v1alpha/gapic_metadata.json new file mode 100644 index 00000000000..ead3e7435db --- /dev/null +++ b/packages/google-cloud-dataqna/src/v1alpha/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.dataqna.v1alpha", + "libraryPackage": "@google-cloud/data-qna", + "services": { + "AutoSuggestionService": { + "clients": { + "grpc": { + "libraryClient": "AutoSuggestionServiceClient", + "rpcs": { + "SuggestQueries": { + "methods": [ + "suggestQueries" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AutoSuggestionServiceClient", + "rpcs": { + "SuggestQueries": { + "methods": [ + "suggestQueries" + ] + } + } + } + } + }, + "QuestionService": { + "clients": { + "grpc": { + "libraryClient": "QuestionServiceClient", + "rpcs": { + "GetQuestion": { + "methods": [ + "getQuestion" + ] + }, + "CreateQuestion": { + "methods": [ + "createQuestion" + ] + }, + "ExecuteQuestion": { + "methods": [ + "executeQuestion" + ] + }, + "GetUserFeedback": { + "methods": [ + "getUserFeedback" + ] + }, + "UpdateUserFeedback": { + "methods": [ + "updateUserFeedback" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "QuestionServiceClient", + "rpcs": { + "GetQuestion": { + "methods": [ + "getQuestion" + ] + }, + "CreateQuestion": { + "methods": [ + "createQuestion" + ] + }, + "ExecuteQuestion": { + "methods": [ + "executeQuestion" + ] + }, + "GetUserFeedback": { + "methods": [ + "getUserFeedback" + ] + }, + "UpdateUserFeedback": { + "methods": [ + "updateUserFeedback" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-dataqna/src/v1alpha/index.ts b/packages/google-cloud-dataqna/src/v1alpha/index.ts new file mode 100644 index 00000000000..db05c90f949 --- /dev/null +++ b/packages/google-cloud-dataqna/src/v1alpha/index.ts @@ -0,0 +1,20 @@ +// 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 {AutoSuggestionServiceClient} from './auto_suggestion_service_client'; +export {QuestionServiceClient} from './question_service_client'; diff --git a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts new file mode 100644 index 00000000000..51f0d2d05e3 --- /dev/null +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -0,0 +1,958 @@ +// 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. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import * as path from 'path'; + +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/question_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './question_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service to interpret natural language queries. + * The service allows to create `Question` resources that are interpreted and + * are filled with one or more interpretations if the question could be + * interpreted. Once a `Question` resource is created and has at least one + * interpretation, an interpretation can be chosen for execution, which + * triggers a query to the backend (for BigQuery, it will create a job). + * Upon successful execution of that interpretation, backend specific + * information will be returned so that the client can retrieve the results + * from the backend. + * + * The `Question` resources are named `projects/* /locations/* /questions/*`. + * + * The `Question` resource has a singletion sub-resource `UserFeedback` named + * `projects/* /locations/* /questions/* /userFeedback`, which allows access to + * user feedback. + * @class + * @memberof v1alpha + */ +export class QuestionServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + questionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of QuestionServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof QuestionServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + questionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/questions/{question}' + ), + userFeedbackPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/questions/{question}/userFeedback' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataqna.v1alpha.QuestionService', + 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.questionServiceStub) { + return this.questionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.dataqna.v1alpha.QuestionService. + this.questionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dataqna.v1alpha.QuestionService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataqna.v1alpha.QuestionService, + 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 questionServiceStubMethods = [ + 'getQuestion', + 'createQuestion', + 'executeQuestion', + 'getUserFeedback', + 'updateUserFeedback', + ]; + for (const methodName of questionServiceStubMethods) { + const callPromise = this.questionServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.questionServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataqna.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dataqna.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getQuestion( + request: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.IQuestion, + protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest | undefined, + {} | undefined + ] + >; + getQuestion( + request: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getQuestion( + request: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets a previously created question. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique identifier for the question. + * Example: `projects/foo/locations/bar/questions/1234` + * @param {google.protobuf.FieldMask} request.readMask + * The list of fields to be retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Question]{@link google.cloud.dataqna.v1alpha.Question}. + * 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.getQuestion(request); + */ + getQuestion( + request: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.IQuestion, + protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest | 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.getQuestion(request, options, callback); + } + createQuestion( + request: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.IQuestion, + protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest | undefined, + {} | undefined + ] + >; + createQuestion( + request: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createQuestion( + request: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a question. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project this data source reference belongs to. + * Example: `projects/foo/locations/bar` + * @param {google.cloud.dataqna.v1alpha.Question} request.question + * Required. The question to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Question]{@link google.cloud.dataqna.v1alpha.Question}. + * 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.createQuestion(request); + */ + createQuestion( + request: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.IQuestion, + protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest | 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.createQuestion(request, options, callback); + } + executeQuestion( + request: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.IQuestion, + protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest | undefined, + {} | undefined + ] + >; + executeQuestion( + request: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + executeQuestion( + request: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Executes an interpretation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique identifier for the question. + * Example: `projects/foo/locations/bar/questions/1234` + * @param {number} request.interpretationIndex + * Required. Index of the interpretation to execute. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Question]{@link google.cloud.dataqna.v1alpha.Question}. + * 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.executeQuestion(request); + */ + executeQuestion( + request: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataqna.v1alpha.IQuestion, + | protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.IQuestion, + protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest | 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.executeQuestion(request, options, callback); + } + getUserFeedback( + request: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest | undefined, + {} | undefined + ] + >; + getUserFeedback( + request: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + | protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getUserFeedback( + request: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + | protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets previously created user feedback. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique identifier for the user feedback. + * User feedback is a singleton resource on a Question. + * Example: `projects/foo/locations/bar/questions/1234/userFeedback` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [UserFeedback]{@link google.cloud.dataqna.v1alpha.UserFeedback}. + * 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.getUserFeedback(request); + */ + getUserFeedback( + request: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + | protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + | protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest | 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.getUserFeedback(request, options, callback); + } + updateUserFeedback( + request: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + ( + | protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest + | undefined + ), + {} | undefined + ] + >; + updateUserFeedback( + request: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + | protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateUserFeedback( + request: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + | protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates user feedback. This creates user feedback if there was none before + * (upsert). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dataqna.v1alpha.UserFeedback} request.userFeedback + * Required. The user feedback to update. This can be called even if there is no + * user feedback so far. + * The feedback's name field is used to identify the user feedback (and the + * corresponding question) to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to 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 [UserFeedback]{@link google.cloud.dataqna.v1alpha.UserFeedback}. + * 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.updateUserFeedback(request); + */ + updateUserFeedback( + request: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + | protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + | protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.IUserFeedback, + ( + | protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest + | 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({ + 'user_feedback.name': request.userFeedback!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateUserFeedback(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified question resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} question + * @returns {string} Resource name string. + */ + questionPath(project: string, location: string, question: string) { + return this.pathTemplates.questionPathTemplate.render({ + project: project, + location: location, + question: question, + }); + } + + /** + * Parse the project from Question resource. + * + * @param {string} questionName + * A fully-qualified path representing Question resource. + * @returns {string} A string representing the project. + */ + matchProjectFromQuestionName(questionName: string) { + return this.pathTemplates.questionPathTemplate.match(questionName).project; + } + + /** + * Parse the location from Question resource. + * + * @param {string} questionName + * A fully-qualified path representing Question resource. + * @returns {string} A string representing the location. + */ + matchLocationFromQuestionName(questionName: string) { + return this.pathTemplates.questionPathTemplate.match(questionName).location; + } + + /** + * Parse the question from Question resource. + * + * @param {string} questionName + * A fully-qualified path representing Question resource. + * @returns {string} A string representing the question. + */ + matchQuestionFromQuestionName(questionName: string) { + return this.pathTemplates.questionPathTemplate.match(questionName).question; + } + + /** + * Return a fully-qualified userFeedback resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} question + * @returns {string} Resource name string. + */ + userFeedbackPath(project: string, location: string, question: string) { + return this.pathTemplates.userFeedbackPathTemplate.render({ + project: project, + location: location, + question: question, + }); + } + + /** + * Parse the project from UserFeedback resource. + * + * @param {string} userFeedbackName + * A fully-qualified path representing UserFeedback resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUserFeedbackName(userFeedbackName: string) { + return this.pathTemplates.userFeedbackPathTemplate.match(userFeedbackName) + .project; + } + + /** + * Parse the location from UserFeedback resource. + * + * @param {string} userFeedbackName + * A fully-qualified path representing UserFeedback resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUserFeedbackName(userFeedbackName: string) { + return this.pathTemplates.userFeedbackPathTemplate.match(userFeedbackName) + .location; + } + + /** + * Parse the question from UserFeedback resource. + * + * @param {string} userFeedbackName + * A fully-qualified path representing UserFeedback resource. + * @returns {string} A string representing the question. + */ + matchQuestionFromUserFeedbackName(userFeedbackName: string) { + return this.pathTemplates.userFeedbackPathTemplate.match(userFeedbackName) + .question; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.questionServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dataqna/src/v1alpha/question_service_client_config.json b/packages/google-cloud-dataqna/src/v1alpha/question_service_client_config.json new file mode 100644 index 00000000000..e3a656fc600 --- /dev/null +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.cloud.dataqna.v1alpha.QuestionService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetQuestion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateQuestion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExecuteQuestion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetUserFeedback": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateUserFeedback": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dataqna/src/v1alpha/question_service_proto_list.json b/packages/google-cloud-dataqna/src/v1alpha/question_service_proto_list.json new file mode 100644 index 00000000000..7411e879740 --- /dev/null +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_proto_list.json @@ -0,0 +1,7 @@ +[ + "../../protos/google/cloud/dataqna/v1alpha/annotated_string.proto", + "../../protos/google/cloud/dataqna/v1alpha/auto_suggestion_service.proto", + "../../protos/google/cloud/dataqna/v1alpha/question.proto", + "../../protos/google/cloud/dataqna/v1alpha/question_service.proto", + "../../protos/google/cloud/dataqna/v1alpha/user_feedback.proto" +] diff --git a/packages/google-cloud-dataqna/synth.metadata b/packages/google-cloud-dataqna/synth.metadata new file mode 100644 index 00000000000..f60f80acc3b --- /dev/null +++ b/packages/google-cloud-dataqna/synth.metadata @@ -0,0 +1,37 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "sso://user/steffanyb/nodejs-data-qna", + "sha": "ce813770b0e899ee68a41f734393940e381ec0f3" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "48fa7512d385dd8ea8e51aab083086858b4dbffe", + "internalRef": "347907714" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "41e998d5afdc2c2143a23c9b044b9931936f7318" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "dataqna", + "apiVersion": "v1alpha", + "language": "nodejs", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-dataqna/synth.py b/packages/google-cloud-dataqna/synth.py index cac12ed9b26..390658a1421 100644 --- a/packages/google-cloud-dataqna/synth.py +++ b/packages/google-cloud-dataqna/synth.py @@ -33,6 +33,6 @@ common_templates = gcp.CommonTemplates() templates = common_templates.node_library( source_location='build/src', versions=['v1alpha'], default_version='v1alpha') -s.copy(templates, excludes=[]) +s.copy(templates, excludes=['README.md','package.json']) node.postprocess_gapic_library() diff --git a/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.js b/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..511c452ec1e --- /dev/null +++ b/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const dataqna = require('@google-cloud/data-qna'); + +function main() { + const autoSuggestionServiceClient = new dataqna.AutoSuggestionServiceClient(); + const questionServiceClient = new dataqna.QuestionServiceClient(); +} + +main(); diff --git a/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..31cb2f41098 --- /dev/null +++ b/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,43 @@ +// 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 { + AutoSuggestionServiceClient, + QuestionServiceClient, +} from '@google-cloud/data-qna'; + +// check that the client class type name can be used +function doStuffWithAutoSuggestionServiceClient( + client: AutoSuggestionServiceClient +) { + client.close(); +} +function doStuffWithQuestionServiceClient(client: QuestionServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const autoSuggestionServiceClient = new AutoSuggestionServiceClient(); + doStuffWithAutoSuggestionServiceClient(autoSuggestionServiceClient); + // check that the client instance can be created + const questionServiceClient = new QuestionServiceClient(); + doStuffWithQuestionServiceClient(questionServiceClient); +} + +main(); diff --git a/packages/google-cloud-dataqna/system-test/install.ts b/packages/google-cloud-dataqna/system-test/install.ts new file mode 100644 index 00000000000..39d90f771de --- /dev/null +++ b/packages/google-cloud-dataqna/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts new file mode 100644 index 00000000000..f4f47a6cd8b --- /dev/null +++ b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts @@ -0,0 +1,451 @@ +// 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 autosuggestionserviceModule from '../src'; + +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); +} + +describe('v1alpha.AutoSuggestionServiceClient', () => { + it('has servicePath', () => { + const servicePath = + autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.autoSuggestionServiceStub, undefined); + await client.initialize(); + assert(client.autoSuggestionServiceStub); + }); + + it('has close method', () => { + const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( + { + 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 autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( + { + 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('suggestQueries', () => { + it('invokes suggestQueries without error', async () => { + const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.SuggestQueriesResponse() + ); + client.innerApiCalls.suggestQueries = stubSimpleCall(expectedResponse); + const [response] = await client.suggestQueries(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestQueries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes suggestQueries without error using callback', async () => { + const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.SuggestQueriesResponse() + ); + client.innerApiCalls.suggestQueries = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.suggestQueries( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestQueries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes suggestQueries with error', async () => { + const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestQueries = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.suggestQueries(request), expectedError); + assert( + (client.innerApiCalls.suggestQueries as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('Path templates', () => { + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('question', () => { + const fakePath = '/rendered/path/question'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + question: 'questionValue', + }; + const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.questionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.questionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('questionPath', () => { + const result = client.questionPath( + 'projectValue', + 'locationValue', + 'questionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.questionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromQuestionName', () => { + const result = client.matchProjectFromQuestionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.questionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromQuestionName', () => { + const result = client.matchLocationFromQuestionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.questionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuestionFromQuestionName', () => { + const result = client.matchQuestionFromQuestionName(fakePath); + assert.strictEqual(result, 'questionValue'); + assert( + (client.pathTemplates.questionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('userFeedback', () => { + const fakePath = '/rendered/path/userFeedback'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + question: 'questionValue', + }; + const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.userFeedbackPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.userFeedbackPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('userFeedbackPath', () => { + const result = client.userFeedbackPath( + 'projectValue', + 'locationValue', + 'questionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.userFeedbackPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromUserFeedbackName', () => { + const result = client.matchProjectFromUserFeedbackName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.userFeedbackPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromUserFeedbackName', () => { + const result = client.matchLocationFromUserFeedbackName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.userFeedbackPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuestionFromUserFeedbackName', () => { + const result = client.matchQuestionFromUserFeedbackName(fakePath); + assert.strictEqual(result, 'questionValue'); + assert( + (client.pathTemplates.userFeedbackPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts new file mode 100644 index 00000000000..054928a5dcf --- /dev/null +++ b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts @@ -0,0 +1,879 @@ +// 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 questionserviceModule from '../src'; + +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); +} + +describe('v1alpha.QuestionServiceClient', () => { + it('has servicePath', () => { + const servicePath = + questionserviceModule.v1alpha.QuestionServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + questionserviceModule.v1alpha.QuestionServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = questionserviceModule.v1alpha.QuestionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.questionServiceStub, undefined); + await client.initialize(); + assert(client.questionServiceStub); + }); + + it('has close method', () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + 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 questionserviceModule.v1alpha.QuestionServiceClient({ + 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('getQuestion', () => { + it('invokes getQuestion without error', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.Question() + ); + client.innerApiCalls.getQuestion = stubSimpleCall(expectedResponse); + const [response] = await client.getQuestion(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getQuestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getQuestion without error using callback', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.Question() + ); + client.innerApiCalls.getQuestion = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getQuestion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataqna.v1alpha.IQuestion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getQuestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getQuestion with error', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getQuestion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getQuestion(request), expectedError); + assert( + (client.innerApiCalls.getQuestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createQuestion', () => { + it('invokes createQuestion without error', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.Question() + ); + client.innerApiCalls.createQuestion = stubSimpleCall(expectedResponse); + const [response] = await client.createQuestion(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createQuestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createQuestion without error using callback', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.Question() + ); + client.innerApiCalls.createQuestion = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createQuestion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataqna.v1alpha.IQuestion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createQuestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createQuestion with error', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createQuestion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createQuestion(request), expectedError); + assert( + (client.innerApiCalls.createQuestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('executeQuestion', () => { + it('invokes executeQuestion without error', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.Question() + ); + client.innerApiCalls.executeQuestion = stubSimpleCall(expectedResponse); + const [response] = await client.executeQuestion(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.executeQuestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes executeQuestion without error using callback', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.Question() + ); + client.innerApiCalls.executeQuestion = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.executeQuestion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataqna.v1alpha.IQuestion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.executeQuestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes executeQuestion with error', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.executeQuestion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.executeQuestion(request), expectedError); + assert( + (client.innerApiCalls.executeQuestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getUserFeedback', () => { + it('invokes getUserFeedback without error', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.UserFeedback() + ); + client.innerApiCalls.getUserFeedback = stubSimpleCall(expectedResponse); + const [response] = await client.getUserFeedback(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getUserFeedback as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getUserFeedback without error using callback', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.UserFeedback() + ); + client.innerApiCalls.getUserFeedback = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getUserFeedback( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataqna.v1alpha.IUserFeedback | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getUserFeedback as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getUserFeedback with error', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getUserFeedback = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getUserFeedback(request), expectedError); + assert( + (client.innerApiCalls.getUserFeedback as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateUserFeedback', () => { + it('invokes updateUserFeedback without error', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() + ); + request.userFeedback = {}; + request.userFeedback.name = ''; + const expectedHeaderRequestParams = 'user_feedback.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.UserFeedback() + ); + client.innerApiCalls.updateUserFeedback = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateUserFeedback(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateUserFeedback as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateUserFeedback without error using callback', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() + ); + request.userFeedback = {}; + request.userFeedback.name = ''; + const expectedHeaderRequestParams = 'user_feedback.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.UserFeedback() + ); + client.innerApiCalls.updateUserFeedback = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateUserFeedback( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataqna.v1alpha.IUserFeedback | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateUserFeedback as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateUserFeedback with error', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() + ); + request.userFeedback = {}; + request.userFeedback.name = ''; + const expectedHeaderRequestParams = 'user_feedback.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUserFeedback = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateUserFeedback(request), expectedError); + assert( + (client.innerApiCalls.updateUserFeedback as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('Path templates', () => { + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('question', () => { + const fakePath = '/rendered/path/question'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + question: 'questionValue', + }; + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.questionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.questionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('questionPath', () => { + const result = client.questionPath( + 'projectValue', + 'locationValue', + 'questionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.questionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromQuestionName', () => { + const result = client.matchProjectFromQuestionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.questionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromQuestionName', () => { + const result = client.matchLocationFromQuestionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.questionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuestionFromQuestionName', () => { + const result = client.matchQuestionFromQuestionName(fakePath); + assert.strictEqual(result, 'questionValue'); + assert( + (client.pathTemplates.questionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('userFeedback', () => { + const fakePath = '/rendered/path/userFeedback'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + question: 'questionValue', + }; + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userFeedbackPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.userFeedbackPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('userFeedbackPath', () => { + const result = client.userFeedbackPath( + 'projectValue', + 'locationValue', + 'questionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.userFeedbackPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromUserFeedbackName', () => { + const result = client.matchProjectFromUserFeedbackName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.userFeedbackPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromUserFeedbackName', () => { + const result = client.matchLocationFromUserFeedbackName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.userFeedbackPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuestionFromUserFeedbackName', () => { + const result = client.matchQuestionFromUserFeedbackName(fakePath); + assert.strictEqual(result, 'questionValue'); + assert( + (client.pathTemplates.userFeedbackPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dataqna/tsconfig.json b/packages/google-cloud-dataqna/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-dataqna/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-dataqna/webpack.config.js b/packages/google-cloud-dataqna/webpack.config.js new file mode 100644 index 00000000000..26afc872832 --- /dev/null +++ b/packages/google-cloud-dataqna/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'AutoSuggestionService', + filename: './auto-suggestion-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; From bedb71acef158054039c2d42cdf5a4cc125d086a Mon Sep 17 00:00:00 2001 From: Steffany Brown <30247553+steffnay@users.noreply.github.com> Date: Thu, 17 Dec 2020 14:15:52 -0800 Subject: [PATCH 04/77] feat!: add samples to library (#1) * feat!: initial library stub * feat!: add tests and samples to library * chore: fix repo name * chore: update samples package name, readme exclude --- packages/google-cloud-dataqna/samples/package.json | 2 +- packages/google-cloud-dataqna/samples/quickstart.js | 5 +++++ .../samples/test/quickstart.test.js | 2 ++ packages/google-cloud-dataqna/synth.metadata | 10 +++++----- packages/google-cloud-dataqna/synth.py | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index e1a2d08be0f..8b33e300e3b 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -1,5 +1,5 @@ { - "name": "nodejs-data-qna", + "name": "nodejs-data-qna-samples", "private": true, "license": "Apache-2.0", "author": "Google LLC", diff --git a/packages/google-cloud-dataqna/samples/quickstart.js b/packages/google-cloud-dataqna/samples/quickstart.js index 6865b268039..60b1e4527e1 100644 --- a/packages/google-cloud-dataqna/samples/quickstart.js +++ b/packages/google-cloud-dataqna/samples/quickstart.js @@ -17,6 +17,11 @@ async function main() { async function quickstart() { + const {AutoSuggestionServiceClient} = require('@google-cloud/data-qna'); + const client = new AutoSuggestionServiceClient(); + + const projectId = await client.getProjectId(); + console.info(`Project: ${projectId}`); } quickstart(); } diff --git a/packages/google-cloud-dataqna/samples/test/quickstart.test.js b/packages/google-cloud-dataqna/samples/test/quickstart.test.js index 55522cd4219..6e6823f7638 100644 --- a/packages/google-cloud-dataqna/samples/test/quickstart.test.js +++ b/packages/google-cloud-dataqna/samples/test/quickstart.test.js @@ -28,5 +28,7 @@ const project = process.env.GCLOUD_PROJECT; describe('Quickstart', () => { it('should run quickstart', async () => { + const stdout = execSync('node ./quickstart.js'); + assert.include(stdout, `Project: ${project}`); }); }); diff --git a/packages/google-cloud-dataqna/synth.metadata b/packages/google-cloud-dataqna/synth.metadata index f60f80acc3b..4a11e54eaf3 100644 --- a/packages/google-cloud-dataqna/synth.metadata +++ b/packages/google-cloud-dataqna/synth.metadata @@ -3,23 +3,23 @@ { "git": { "name": ".", - "remote": "sso://user/steffanyb/nodejs-data-qna", - "sha": "ce813770b0e899ee68a41f734393940e381ec0f3" + "remote": "git@github.com:steffnay/nodejs-data-qna.git", + "sha": "fae21956bafc35c2c9943cbdb147bdc85640e663" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "48fa7512d385dd8ea8e51aab083086858b4dbffe", - "internalRef": "347907714" + "sha": "15af12eb717cd30175825ad412045b9e59b133b4", + "internalRef": "348046114" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "41e998d5afdc2c2143a23c9b044b9931936f7318" + "sha": "b670a77a454f415d247907908e8ee7943e06d718" } } ], diff --git a/packages/google-cloud-dataqna/synth.py b/packages/google-cloud-dataqna/synth.py index 390658a1421..2f17e717df0 100644 --- a/packages/google-cloud-dataqna/synth.py +++ b/packages/google-cloud-dataqna/synth.py @@ -33,6 +33,6 @@ common_templates = gcp.CommonTemplates() templates = common_templates.node_library( source_location='build/src', versions=['v1alpha'], default_version='v1alpha') -s.copy(templates, excludes=['README.md','package.json']) +s.copy(templates, excludes=['README.md', 'package.json']) node.postprocess_gapic_library() From a2510ba12d191821e08cb3e31068157b4aa0c99d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 17 Dec 2020 14:20:47 -0800 Subject: [PATCH 05/77] chore: release 1.0.0 (#3) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-dataqna/CHANGELOG.md | 14 ++++++++++++++ packages/google-cloud-dataqna/package.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-dataqna/CHANGELOG.md diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md new file mode 100644 index 00000000000..79ae2bcbc16 --- /dev/null +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +## 1.0.0 (2020-12-17) + + +### ⚠ BREAKING CHANGES + +* add samples to library (#1) +* initial library stub + +### Features + +* add samples to library ([#1](https://www.github.com/googleapis/nodejs-data-qna/issues/1)) ([35ad521](https://www.github.com/googleapis/nodejs-data-qna/commit/35ad521b43b896152c3652b3b265b66d6c66b9cd)) +* initial library stub ([03b5a88](https://www.github.com/googleapis/nodejs-data-qna/commit/03b5a88d51e77dfb2c19d44d22e18db3135db9fb)) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 0ef5fbce0be..ccd8ca41841 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "0.1.0", + "version": "1.0.0", "description": "Data QnA client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index 8b33e300e3b..ea0e73d91ee 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^0.1.0" + "@google-cloud/data-qna": "^1.0.0" }, "devDependencies": { "c8": "^7.1.0", From 381becfd506233022833f3820ed361d61b2937f4 Mon Sep 17 00:00:00 2001 From: Sujay Krishna Suresh Date: Thu, 17 Dec 2020 15:32:56 -0800 Subject: [PATCH 06/77] docs: add allowlist warning to README (#4) * docs: add allowlist warning to README * add link to application form --- packages/google-cloud-dataqna/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index 3e81ac34f98..322865d11fb 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -9,8 +9,6 @@ [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-qna/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-qna) - - Dataqna client for Node.js @@ -21,6 +19,10 @@ A comprehensive list of changes in each version may be found in * [Data QnA Documentation][product-docs] * [github.com/googleapis/nodejs-data-qna](https://github.com/googleapis/nodejs-data-qna) +> **:warning: WARNING:** +> Data QnA is currently in private Alpha. Access is only available to + allowlisted users. Apply for access [here](http://g.co/cloud/data-qna). + Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. From f3cbf60a3b9166d38027fe6428138374efe23296 Mon Sep 17 00:00:00 2001 From: Steffany Brown <30247553+steffnay@users.noreply.github.com> Date: Mon, 21 Dec 2020 12:02:21 -0800 Subject: [PATCH 07/77] fix: fix docs links (#6) * fix: fix docs links * replace warning --- packages/google-cloud-dataqna/.repo-metadata.json | 2 +- packages/google-cloud-dataqna/README.md | 4 +++- packages/google-cloud-dataqna/linkinator.config.json | 4 ++-- packages/google-cloud-dataqna/synth.metadata | 6 +++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-dataqna/.repo-metadata.json b/packages/google-cloud-dataqna/.repo-metadata.json index fa91ab382aa..88110af66b2 100644 --- a/packages/google-cloud-dataqna/.repo-metadata.json +++ b/packages/google-cloud-dataqna/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "dataqna", "name_pretty": "Data QnA", "product_documentation": "https://cloud.google.com/bigquery/docs/dataqna", - "client_documentation": "https://googleapis.dev/python/dataqna/latest", + "client_documentation": "https://googleapis.dev/nodejs/dataqna/latest", "issue_tracker": "", "release_level": "alpha", "language": "nodejs", diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index 322865d11fb..ab14abc4c13 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -9,6 +9,8 @@ [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-qna/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-qna) + + Dataqna client for Node.js @@ -117,7 +119,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-data-qna/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/python/dataqna/latest +[client-docs]: https://googleapis.dev/nodejs/dataqna/latest [product-docs]: https://cloud.google.com/bigquery/docs/dataqna [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project diff --git a/packages/google-cloud-dataqna/linkinator.config.json b/packages/google-cloud-dataqna/linkinator.config.json index bff657b4163..48e50f4c55f 100644 --- a/packages/google-cloud-dataqna/linkinator.config.json +++ b/packages/google-cloud-dataqna/linkinator.config.json @@ -3,9 +3,9 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", + "https://googleapis.dev", "img.shields.io", - "https://cloud.google.com/bigquery/docs/dataqna", - "https://github.com/googleapis/nodejs-data-qna" + "https://cloud.google.com/bigquery/docs/dataqna" ], "silent": true, "concurrency": 10 diff --git a/packages/google-cloud-dataqna/synth.metadata b/packages/google-cloud-dataqna/synth.metadata index 4a11e54eaf3..b83c2074ab7 100644 --- a/packages/google-cloud-dataqna/synth.metadata +++ b/packages/google-cloud-dataqna/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "git@github.com:steffnay/nodejs-data-qna.git", - "sha": "fae21956bafc35c2c9943cbdb147bdc85640e663" + "sha": "9d9b3d592befc7790db765c3659cfd4f826628b1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "15af12eb717cd30175825ad412045b9e59b133b4", - "internalRef": "348046114" + "sha": "c1a601690b7fdfc2ca7a070038546321102b5f0b", + "internalRef": "348091500" } }, { From ee32c1062338bdd69d373f94add8284bb895dcea Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 22 Jan 2021 19:28:22 +0100 Subject: [PATCH 08/77] chore(deps): update dependency mocha to v8 (#7) --- packages/google-cloud-dataqna/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index ea0e73d91ee..c6d03618b99 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -18,6 +18,6 @@ "devDependencies": { "c8": "^7.1.0", "chai": "^4.2.0", - "mocha": "^7.1.0" + "mocha": "^8.0.0" } } From 2fa9888c174a8f8a5dda892ef16b1650d5cc8ccc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 22 Jan 2021 11:44:46 -0800 Subject: [PATCH 09/77] chore: release 1.0.1 (#10) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-dataqna/CHANGELOG.md | 7 +++++++ packages/google-cloud-dataqna/package.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index 79ae2bcbc16..d5c405c4c0c 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.1](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.0...v1.0.1) (2021-01-22) + + +### Bug Fixes + +* fix docs links ([#6](https://www.github.com/googleapis/nodejs-data-qna/issues/6)) ([48558f2](https://www.github.com/googleapis/nodejs-data-qna/commit/48558f2c18da5b404fc97aec6fd57ae17e0fb7c2)) + ## 1.0.0 (2020-12-17) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index ccd8ca41841..8af87bc9d7b 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "1.0.0", + "version": "1.0.1", "description": "Data QnA client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index c6d03618b99..2c57b9b9d0c 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^1.0.0" + "@google-cloud/data-qna": "^1.0.1" }, "devDependencies": { "c8": "^7.1.0", From c95e7ac260e007a22d89311e8984843d75e720a8 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 25 Feb 2021 13:12:49 -0800 Subject: [PATCH 10/77] build: update synth.py, rerun synthtool (#13) * build: update synth.py, rerun synthtool * build: update repo name --- packages/google-cloud-dataqna/.jsdoc.js | 4 +- packages/google-cloud-dataqna/CONTRIBUTING.md | 15 +- packages/google-cloud-dataqna/README.md | 129 +----------------- .../linkinator.config.json | 4 +- packages/google-cloud-dataqna/package.json | 8 +- .../google-cloud-dataqna/protos/protos.d.ts | 17 ++- .../google-cloud-dataqna/protos/protos.js | 87 +++++++++++- .../google-cloud-dataqna/protos/protos.json | 16 ++- .../v1alpha/auto_suggestion_service_client.ts | 2 +- .../google-cloud-dataqna/src/v1alpha/index.ts | 2 +- .../src/v1alpha/question_service_client.ts | 2 +- packages/google-cloud-dataqna/synth.metadata | 10 +- packages/google-cloud-dataqna/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_auto_suggestion_service_v1alpha.ts | 2 +- .../test/gapic_question_service_v1alpha.ts | 2 +- 18 files changed, 149 insertions(+), 159 deletions(-) diff --git a/packages/google-cloud-dataqna/.jsdoc.js b/packages/google-cloud-dataqna/.jsdoc.js index 630df58a8cf..e1f30aa716b 100644 --- a/packages/google-cloud-dataqna/.jsdoc.js +++ b/packages/google-cloud-dataqna/.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/data-qna', diff --git a/packages/google-cloud-dataqna/CONTRIBUTING.md b/packages/google-cloud-dataqna/CONTRIBUTING.md index f6c4cf010e3..24c74f9161e 100644 --- a/packages/google-cloud-dataqna/CONTRIBUTING.md +++ b/packages/google-cloud-dataqna/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 Data QnA 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=dataqna.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index ab14abc4c13..3665700a48f 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -1,128 +1 @@ -[//]: # "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 - -# [Data QnA: Node.js Client](https://github.com/googleapis/nodejs-data-qna) - -[![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/@google-cloud/data-qna.svg)](https://www.npmjs.org/package/@google-cloud/data-qna) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-qna/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-qna) - - - - -Dataqna client for Node.js - - -A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-data-qna/blob/master/CHANGELOG.md). - -* [Data QnA Node.js Client API Reference][client-docs] -* [Data QnA Documentation][product-docs] -* [github.com/googleapis/nodejs-data-qna](https://github.com/googleapis/nodejs-data-qna) - -> **:warning: WARNING:** -> Data QnA is currently in private Alpha. Access is only available to - allowlisted users. Apply for access [here](http://g.co/cloud/data-qna). - -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 Data QnA API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - -### Installing the client library - -```bash -npm install @google-cloud/data-qna -``` - - - - - -The [Data QnA Node.js Client API Reference][client-docs] documentation -also contains samples. - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. - -_Legacy Node.js versions are supported as a best effort:_ - -* Legacy versions will not be tested in continuous integration. -* Some security patches may not be able to be backported. -* Dependencies will not be kept up-to-date, and features will not be backported. - -#### Legacy tags available - -* `legacy-8`: install client libraries from this dist-tag for versions - compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - - - - -This library is considered to be in **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-data-qna/blob/master/CONTRIBUTING.md). - -Please note that this `README.md`, the `samples/README.md`, -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. To edit one of these files, make an edit -to its template in this -[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/nodejs-data-qna/blob/master/LICENSE) - -[client-docs]: https://googleapis.dev/nodejs/dataqna/latest -[product-docs]: https://cloud.google.com/bigquery/docs/dataqna -[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=dataqna.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started +Dataqna: Nodejs Client diff --git a/packages/google-cloud-dataqna/linkinator.config.json b/packages/google-cloud-dataqna/linkinator.config.json index 48e50f4c55f..29a223b6db6 100644 --- a/packages/google-cloud-dataqna/linkinator.config.json +++ b/packages/google-cloud-dataqna/linkinator.config.json @@ -3,9 +3,7 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "https://googleapis.dev", - "img.shields.io", - "https://cloud.google.com/bigquery/docs/dataqna" + "img.shields.io" ], "silent": true, "concurrency": 10 diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 8af87bc9d7b..cb97388cd16 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/data-qna", - "version": "1.0.1", - "description": "Data QnA client for Node.js", + "version": "0.1.0", + "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", "author": "Google LLC", @@ -32,10 +32,10 @@ "predocs-test": "npm run docs", "docs-test": "linkinator docs", "fix": "gts fix", - "prelint": "cd samples; npm link ../; npm install", + "prelint": "cd samples; npm link ../; npm i", "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", "samples-test": "cd samples/ && npm link ../ && npm test", + "prepare": "npm run compile-protos && npm run compile", "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test" }, diff --git a/packages/google-cloud-dataqna/protos/protos.d.ts b/packages/google-cloud-dataqna/protos/protos.d.ts index d9c3422a707..af3f73d8385 100644 --- a/packages/google-cloud-dataqna/protos/protos.d.ts +++ b/packages/google-cloud-dataqna/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. @@ -3396,7 +3396,8 @@ export namespace google { REQUIRED = 2, OUTPUT_ONLY = 3, INPUT_ONLY = 4, - IMMUTABLE = 5 + IMMUTABLE = 5, + UNORDERED_LIST = 6 } /** Properties of a ResourceDescriptor. */ @@ -3419,6 +3420,9 @@ export namespace google { /** ResourceDescriptor singular */ singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } /** Represents a ResourceDescriptor. */ @@ -3448,6 +3452,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 @@ -3527,6 +3534,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-dataqna/protos/protos.js b/packages/google-cloud-dataqna/protos/protos.js index 44b7dab3d46..d61424960a8 100644 --- a/packages/google-cloud-dataqna/protos/protos.js +++ b/packages/google-cloud-dataqna/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. @@ -8348,6 +8348,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); @@ -8357,6 +8358,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; })(); @@ -8372,6 +8374,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 */ /** @@ -8384,6 +8387,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) @@ -8438,6 +8442,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 @@ -8475,6 +8487,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; }; @@ -8529,6 +8547,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; @@ -8592,6 +8620,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; }; @@ -8636,6 +8676,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; }; @@ -8652,8 +8709,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 = ""; @@ -8676,6 +8735,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; }; @@ -8706,6 +8770,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; })(); @@ -14448,6 +14526,7 @@ case 3: case 4: case 5: + case 6: break; } } @@ -14548,6 +14627,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-dataqna/protos/protos.json b/packages/google-cloud-dataqna/protos/protos.json index 827535fc39e..5726f2f2546 100644 --- a/packages/google-cloud-dataqna/protos/protos.json +++ b/packages/google-cloud-dataqna/protos/protos.json @@ -843,7 +843,8 @@ "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, - "IMMUTABLE": 5 + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 } }, "resourceReference": { @@ -888,6 +889,11 @@ "singular": { "type": "string", "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 } }, "nested": { @@ -897,6 +903,12 @@ "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2 } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } } } }, @@ -932,7 +944,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-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index cefdb3cd27a..b1bbbf23caf 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_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-dataqna/src/v1alpha/index.ts b/packages/google-cloud-dataqna/src/v1alpha/index.ts index db05c90f949..9de71b5c8d2 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/index.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/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-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index 51f0d2d05e3..3361a67d1a3 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_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-dataqna/synth.metadata b/packages/google-cloud-dataqna/synth.metadata index b83c2074ab7..e3a5101ec6d 100644 --- a/packages/google-cloud-dataqna/synth.metadata +++ b/packages/google-cloud-dataqna/synth.metadata @@ -3,23 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:steffnay/nodejs-data-qna.git", - "sha": "9d9b3d592befc7790db765c3659cfd4f826628b1" + "remote": "git@github.com:googleapis/nodejs-data-qna.git", + "sha": "b2705dfcf6b966b66f92f6662751ca15ea263980" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1a601690b7fdfc2ca7a070038546321102b5f0b", - "internalRef": "348091500" + "sha": "e69f9d4f00a558a359a55f3bb33ba582d6bfc805", + "internalRef": "359593247" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b670a77a454f415d247907908e8ee7943e06d718" + "sha": "8c5628b86cfa8386de7b8fc1675e6b528b552d57" } } ], diff --git a/packages/google-cloud-dataqna/synth.py b/packages/google-cloud-dataqna/synth.py index 2f17e717df0..524778452ce 100644 --- a/packages/google-cloud-dataqna/synth.py +++ b/packages/google-cloud-dataqna/synth.py @@ -27,7 +27,7 @@ name = 'dataqna' for version in versions: library = gapic.node_library(name, version) - s.copy(library, excludes=[]) + s.copy(library, excludes=["README.md", "package.json"]) # Copy common templates common_templates = gcp.CommonTemplates() diff --git a/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.js b/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.js index 511c452ec1e..dd48c391861 100644 --- a/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-dataqna/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-dataqna/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.ts index 31cb2f41098..f331e6d3a8a 100644 --- a/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-dataqna/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-dataqna/system-test/install.ts b/packages/google-cloud-dataqna/system-test/install.ts index 39d90f771de..d2d61c0396f 100644 --- a/packages/google-cloud-dataqna/system-test/install.ts +++ b/packages/google-cloud-dataqna/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-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts index f4f47a6cd8b..285c66ae641 100644 --- a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.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-dataqna/test/gapic_question_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts index 054928a5dcf..02796de7d45 100644 --- a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.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 b0fbb9a198c1eea0dea34c5f6a6222b1f8ab23c8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 7 Mar 2021 09:00:11 -0800 Subject: [PATCH 11/77] build: update gapic-generator-typescript to v1.2.10. (#14) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/462962a3-9240-4e8b-ac6c-093ca469e60b/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 361273630 Source-Link: https://github.com/googleapis/googleapis/commit/5477122b3e8037a1dc5bc920536158edbd151dc4 --- packages/google-cloud-dataqna/synth.metadata | 8 ++++---- packages/google-cloud-dataqna/webpack.config.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-dataqna/synth.metadata b/packages/google-cloud-dataqna/synth.metadata index e3a5101ec6d..bf61fe01a0e 100644 --- a/packages/google-cloud-dataqna/synth.metadata +++ b/packages/google-cloud-dataqna/synth.metadata @@ -3,16 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-data-qna.git", - "sha": "b2705dfcf6b966b66f92f6662751ca15ea263980" + "remote": "https://github.com/googleapis/nodejs-data-qna.git", + "sha": "8366ec1ed2a2edcb6be7acf2b854a544635001e1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e69f9d4f00a558a359a55f3bb33ba582d6bfc805", - "internalRef": "359593247" + "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", + "internalRef": "361273630" } }, { diff --git a/packages/google-cloud-dataqna/webpack.config.js b/packages/google-cloud-dataqna/webpack.config.js index 26afc872832..4dbbcadd90d 100644 --- a/packages/google-cloud-dataqna/webpack.config.js +++ b/packages/google-cloud-dataqna/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 8b8da474c29055e1ef721ff2b572f6e324ab002e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Mar 2021 17:52:21 +0100 Subject: [PATCH 12/77] chore(deps): update dependency sinon to v10 (#16) [![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.2.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-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index cb97388cd16..3e2c490b4b8 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -55,7 +55,7 @@ "mocha": "^8.2.1", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^9.2.1", + "sinon": "^10.0.0", "ts-loader": "^8.0.11", "typescript": "^4.1.2", "webpack": "^5.9.0", From 4bf914212a530526b1e9e77da9fa360d8677f6b6 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 6 Apr 2021 14:27:30 -0700 Subject: [PATCH 13/77] chore: migrate to owl bot (#17) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: migrate to owl bot * chore: copy files from googleapis-gen fb91803ccef5d7c695139b22788b309e2197856b * chore: run the post processor * docs: update the readme to leave out the doc link until it's released * 🦉 Updates from OwlBot * docs: change docs link to something world-readable, for now Second try's the charm? * 🦉 Updates from OwlBot Co-authored-by: Megan Potter <57276408+feywind@users.noreply.github.com> Co-authored-by: Owl Bot --- .../google-cloud-dataqna/.github/.OwlBot.yaml | 25 ++++ .../google-cloud-dataqna/.repo-metadata.json | 15 ++- packages/google-cloud-dataqna/README.md | 125 +++++++++++++++++- packages/google-cloud-dataqna/synth.metadata | 37 ------ packages/google-cloud-dataqna/synth.py | 38 ------ 5 files changed, 157 insertions(+), 83 deletions(-) create mode 100644 packages/google-cloud-dataqna/.github/.OwlBot.yaml delete mode 100644 packages/google-cloud-dataqna/synth.metadata delete mode 100644 packages/google-cloud-dataqna/synth.py diff --git a/packages/google-cloud-dataqna/.github/.OwlBot.yaml b/packages/google-cloud-dataqna/.github/.OwlBot.yaml new file mode 100644 index 00000000000..03a556dba80 --- /dev/null +++ b/packages/google-cloud-dataqna/.github/.OwlBot.yaml @@ -0,0 +1,25 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/dataqna/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-dataqna/.repo-metadata.json b/packages/google-cloud-dataqna/.repo-metadata.json index 88110af66b2..4d1b11c06b8 100644 --- a/packages/google-cloud-dataqna/.repo-metadata.json +++ b/packages/google-cloud-dataqna/.repo-metadata.json @@ -1,13 +1,14 @@ { - "name": "dataqna", - "name_pretty": "Data QnA", - "product_documentation": "https://cloud.google.com/bigquery/docs/dataqna", - "client_documentation": "https://googleapis.dev/nodejs/dataqna/latest", - "issue_tracker": "", - "release_level": "alpha", "language": "nodejs", + "requires_billing": true, + "product_documentation": "https://cloud.google.com/bigquery/docs", "repo": "googleapis/nodejs-data-qna", + "default_version": "v1alpha", + "name_pretty": "Data QnA", + "release_level": "alpha", "distribution_name": "@google-cloud/data-qna", + "name": "dataqna", + "client_documentation": "https://googleapis.dev/nodejs/dataqna/latest", "api_id": "dataqna.googleapis.com", - "requires_billing": true + "issue_tracker": "" } diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index 3665700a48f..2c5163758af 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -1 +1,124 @@ -Dataqna: Nodejs Client +[//]: # "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 + +# [Data QnA: Node.js Client](https://github.com/googleapis/nodejs-data-qna) + +[![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/@google-cloud/data-qna.svg)](https://www.npmjs.org/package/@google-cloud/data-qna) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-qna/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-qna) + + + + +Dataqna client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-data-qna/blob/master/CHANGELOG.md). + +* [Data QnA Node.js Client API Reference][client-docs] +* [Data QnA Documentation][product-docs] +* [github.com/googleapis/nodejs-data-qna](https://github.com/googleapis/nodejs-data-qna) + +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 Data QnA API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/data-qna +``` + + + + + +The [Data QnA Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + +This library is considered to be in **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-data-qna/blob/master/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its template in this +[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-data-qna/blob/master/LICENSE) + +[client-docs]: https://googleapis.dev/nodejs/dataqna/latest +[product-docs]: https://cloud.google.com/bigquery/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=dataqna.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-dataqna/synth.metadata b/packages/google-cloud-dataqna/synth.metadata deleted file mode 100644 index bf61fe01a0e..00000000000 --- a/packages/google-cloud-dataqna/synth.metadata +++ /dev/null @@ -1,37 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-data-qna.git", - "sha": "8366ec1ed2a2edcb6be7acf2b854a544635001e1" - } - }, - { - "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": "8c5628b86cfa8386de7b8fc1675e6b528b552d57" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "dataqna", - "apiVersion": "v1alpha", - "language": "nodejs", - "generator": "bazel" - } - } - ] -} \ No newline at end of file diff --git a/packages/google-cloud-dataqna/synth.py b/packages/google-cloud-dataqna/synth.py deleted file mode 100644 index 524778452ce..00000000000 --- a/packages/google-cloud-dataqna/synth.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import synthtool.languages.node as node -import subprocess -import logging - -logging.basicConfig(level=logging.DEBUG) - -# run the gapic generator -gapic = gcp.GAPICBazel() -versions = ['v1alpha'] -name = 'dataqna' -for version in versions: - library = gapic.node_library(name, version) - s.copy(library, excludes=["README.md", "package.json"]) - -# Copy common templates -common_templates = gcp.CommonTemplates() -templates = common_templates.node_library( - source_location='build/src', versions=['v1alpha'], default_version='v1alpha') -s.copy(templates, excludes=['README.md', 'package.json']) - -node.postprocess_gapic_library() From 3f3be656dce18fd0e4ba0ed8b792478ac82bc198 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:50:03 +0200 Subject: [PATCH 14/77] chore(deps): update dependency @types/sinon to v10 (#20) [![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.9` -> `^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-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 3e2c490b4b8..87d4b1d5efc 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -45,7 +45,7 @@ "devDependencies": { "@types/mocha": "^8.0.4", "@types/node": "^14.14.10", - "@types/sinon": "^9.0.9", + "@types/sinon": "^10.0.0", "c8": "^7.3.5", "gts": "^3.0.3", "jsdoc": "^3.6.6", From e52969e79bff530b56e7269cb289157410c47293 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Apr 2021 00:56:54 +0200 Subject: [PATCH 15/77] chore(deps): update dependency ts-loader to v9 (#24) [![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.11` -> `^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-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 87d4b1d5efc..ffc490ae266 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -56,7 +56,7 @@ "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", "sinon": "^10.0.0", - "ts-loader": "^8.0.11", + "ts-loader": "^9.0.0", "typescript": "^4.1.2", "webpack": "^5.9.0", "webpack-cli": "^4.2.0" From 0bf50ea282500a46899b827089753b6e887ff2b6 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 May 2021 17:52:40 -0700 Subject: [PATCH 16/77] fix(deps): require google-gax v2.12.0 (#28) --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index ffc490ae266..16686ab51f7 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -40,7 +40,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.9.2" + "google-gax": "^2.12.0" }, "devDependencies": { "@types/mocha": "^8.0.4", From bdb3dd3f8a87891d62725490652e873a1ce737f8 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:42 +0000 Subject: [PATCH 17/77] chore: new owl bot post processor docker image (#30) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../google-cloud-dataqna/protos/protos.d.ts | 10 +- .../google-cloud-dataqna/protos/protos.js | 20 ++-- .../v1alpha/auto_suggestion_service_client.ts | 24 ++--- .../src/v1alpha/question_service_client.ts | 60 ++++++------ .../gapic_auto_suggestion_service_v1alpha.ts | 92 ++++++++----------- .../test/gapic_question_service_v1alpha.ts | 37 +++----- 6 files changed, 110 insertions(+), 133 deletions(-) diff --git a/packages/google-cloud-dataqna/protos/protos.d.ts b/packages/google-cloud-dataqna/protos/protos.d.ts index af3f73d8385..f77b2e6d8df 100644 --- a/packages/google-cloud-dataqna/protos/protos.d.ts +++ b/packages/google-cloud-dataqna/protos/protos.d.ts @@ -3193,19 +3193,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-dataqna/protos/protos.js b/packages/google-cloud-dataqna/protos/protos.js index d61424960a8..015cdb5b67a 100644 --- a/packages/google-cloud-dataqna/protos/protos.js +++ b/packages/google-cloud-dataqna/protos/protos.js @@ -7709,43 +7709,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-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index b1bbbf23caf..5213486e1fa 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -283,13 +283,14 @@ export class AutoSuggestionServiceClient { const autoSuggestionServiceStubMethods = ['suggestQueries']; for (const methodName of autoSuggestionServiceStubMethods) { const callPromise = this.autoSuggestionServiceStub.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; } @@ -462,11 +463,10 @@ export class AutoSuggestionServiceClient { 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.suggestQueries(request, options, callback); } diff --git a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index 3361a67d1a3..7acdc524874 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -236,13 +236,14 @@ export class QuestionServiceClient { ]; for (const methodName of questionServiceStubMethods) { const callPromise = this.questionServiceStub.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; } @@ -401,11 +402,10 @@ export class QuestionServiceClient { 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.getQuestion(request, options, callback); } @@ -496,11 +496,10 @@ export class QuestionServiceClient { 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.createQuestion(request, options, callback); } @@ -591,11 +590,10 @@ export class QuestionServiceClient { 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.executeQuestion(request, options, callback); } @@ -685,11 +683,10 @@ export class QuestionServiceClient { 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.getUserFeedback(request, options, callback); } @@ -789,11 +786,10 @@ export class QuestionServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'user_feedback.name': request.userFeedback!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'user_feedback.name': request.userFeedback!.name || '', + }); this.initialize(); return this.innerApiCalls.updateUserFeedback(request, options, callback); } diff --git a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts index 285c66ae641..40e117d6077 100644 --- a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts @@ -26,10 +26,9 @@ import * as autosuggestionserviceModule from '../src'; 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; @@ -73,49 +72,46 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { }); it('should create a client with no option', () => { - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient(); + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( - { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ fallback: true, - } - ); + }); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( - { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); assert.strictEqual(client.autoSuggestionServiceStub, undefined); await client.initialize(); assert(client.autoSuggestionServiceStub); }); it('has close method', () => { - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( - { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( - { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ 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); @@ -124,12 +120,11 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( - { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -148,12 +143,11 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { describe('suggestQueries', () => { it('invokes suggestQueries without error', async () => { - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( - { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() @@ -181,12 +175,11 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { }); it('invokes suggestQueries without error using callback', async () => { - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( - { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() @@ -203,9 +196,8 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesResponse() ); - client.innerApiCalls.suggestQueries = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.suggestQueries = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.suggestQueries( request, @@ -231,12 +223,11 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { }); it('invokes suggestQueries with error', async () => { - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( - { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() @@ -271,12 +262,11 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { project: 'projectValue', location: 'locationValue', }; - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( - { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.locationPathTemplate.render = sinon .stub() @@ -323,12 +313,11 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { location: 'locationValue', question: 'questionValue', }; - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( - { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.questionPathTemplate.render = sinon .stub() @@ -389,12 +378,11 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { location: 'locationValue', question: 'questionValue', }; - const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient( - { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.userFeedbackPathTemplate.render = sinon .stub() diff --git a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts index 02796de7d45..d5ee47dbc3f 100644 --- a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts @@ -26,10 +26,9 @@ import * as questionserviceModule from '../src'; 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; @@ -186,9 +185,8 @@ describe('v1alpha.QuestionServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.Question() ); - client.innerApiCalls.getQuestion = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getQuestion = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getQuestion( request, @@ -298,9 +296,8 @@ describe('v1alpha.QuestionServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.Question() ); - client.innerApiCalls.createQuestion = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createQuestion = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createQuestion( request, @@ -410,9 +407,8 @@ describe('v1alpha.QuestionServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.Question() ); - client.innerApiCalls.executeQuestion = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.executeQuestion = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.executeQuestion( request, @@ -522,9 +518,8 @@ describe('v1alpha.QuestionServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.UserFeedback() ); - client.innerApiCalls.getUserFeedback = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getUserFeedback = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getUserFeedback( request, @@ -604,9 +599,8 @@ describe('v1alpha.QuestionServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.UserFeedback() ); - client.innerApiCalls.updateUserFeedback = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateUserFeedback = + stubSimpleCall(expectedResponse); const [response] = await client.updateUserFeedback(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -638,9 +632,8 @@ describe('v1alpha.QuestionServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.UserFeedback() ); - client.innerApiCalls.updateUserFeedback = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateUserFeedback = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateUserFeedback( request, From d52f06e528187ed9fc8458180c5294ca433d0041 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:58:06 +0000 Subject: [PATCH 18/77] fix: use require() to load JSON protos (#31) 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 --- .../v1alpha/auto_suggestion_service_client.ts | 18 ++---------------- .../src/v1alpha/question_service_client.ts | 18 ++---------------- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index 5213486e1fa..d55f50028aa 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -22,6 +22,7 @@ import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1alpha/auto_suggestion_service_client_config.json`. @@ -202,22 +203,7 @@ export class AutoSuggestionServiceClient { 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-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index 7acdc524874..406b67553ac 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -22,6 +22,7 @@ import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1alpha/question_service_client_config.json`. @@ -150,22 +151,7 @@ export class QuestionServiceClient { 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 f10816cdbf6c27d43fad2d85cb2b9a6f141b947d 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:48 +0000 Subject: [PATCH 19/77] chore: update gapic-generator-typescript to v1.3.2 (#32) 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/v1alpha/auto_suggestion_service_client.ts | 1 - .../google-cloud-dataqna/src/v1alpha/question_service_client.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index d55f50028aa..be386a99469 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -19,7 +19,6 @@ /* global window */ import * as gax from 'google-gax'; import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; -import * as path from 'path'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); diff --git a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index 406b67553ac..a4af19b3d1d 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -19,7 +19,6 @@ /* global window */ import * as gax from 'google-gax'; import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; -import * as path from 'path'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); From 96b608be9436040c8877ba89d9a54c7a75d82ebe 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:29:03 -0700 Subject: [PATCH 20/77] chore: release 1.0.2 (#29) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-dataqna/CHANGELOG.md | 8 ++++++++ packages/google-cloud-dataqna/package.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index d5c405c4c0c..557f34b974a 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.0.2](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.1...v1.0.2) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#28](https://www.github.com/googleapis/nodejs-data-qna/issues/28)) ([df1e1cf](https://www.github.com/googleapis/nodejs-data-qna/commit/df1e1cfbe00985ec6d10418ebdef313b4601985a)) +* use require() to load JSON protos ([#31](https://www.github.com/googleapis/nodejs-data-qna/issues/31)) ([1ab9737](https://www.github.com/googleapis/nodejs-data-qna/commit/1ab9737dc7901bfd397e8ea13682bc1a7e6d78cb)) + ### [1.0.1](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.0...v1.0.1) (2021-01-22) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 16686ab51f7..26091dbb9b1 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "0.1.0", + "version": "1.0.2", "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index 2c57b9b9d0c..11d2ce2d3d5 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^1.0.1" + "@google-cloud/data-qna": "^1.0.2" }, "devDependencies": { "c8": "^7.1.0", From 52b27d201aad1b3466ccc56ff4a0b657b83f8e33 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 17:58:18 +0200 Subject: [PATCH 21/77] chore(deps): update dependency sinon to v11 (#35) 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-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 26091dbb9b1..663d301cac7 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -55,7 +55,7 @@ "mocha": "^8.2.1", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^10.0.0", + "sinon": "^11.0.0", "ts-loader": "^9.0.0", "typescript": "^4.1.2", "webpack": "^5.9.0", From 96ad22d81e8da4a1884a81f7f11aed8cf5121a65 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:52 +0000 Subject: [PATCH 22/77] fix: GoogleAdsError missing using generator version after 1.3.0 (#36) [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/v1alpha/auto_suggestion_service_client.ts | 2 ++ .../google-cloud-dataqna/src/v1alpha/question_service_client.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index be386a99469..764561f4578 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -197,6 +197,8 @@ export class AutoSuggestionServiceClient { } 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-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index a4af19b3d1d..c067d33ce57 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -145,6 +145,8 @@ export class QuestionServiceClient { } 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 953be867aadcebc64c43ebf012dfd9549e96c056 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Jun 2021 18:07:44 -0700 Subject: [PATCH 23/77] chore: release 1.0.3 (#37) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-dataqna/CHANGELOG.md | 7 +++++++ packages/google-cloud-dataqna/package.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index 557f34b974a..9fd9197450d 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.3](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.2...v1.0.3) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#36](https://www.github.com/googleapis/nodejs-data-qna/issues/36)) ([40c69dc](https://www.github.com/googleapis/nodejs-data-qna/commit/40c69dc32d2db3b871459dcec2e2b883fa866097)) + ### [1.0.2](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.1...v1.0.2) (2021-05-12) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 663d301cac7..c0fc8ea49f2 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "1.0.2", + "version": "1.0.3", "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index 11d2ce2d3d5..80b5d9aae23 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^1.0.2" + "@google-cloud/data-qna": "^1.0.3" }, "devDependencies": { "c8": "^7.1.0", From 4f0e91a600853491fa3a64cf87cdbbc8dddf2e44 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:22:43 +0000 Subject: [PATCH 24/77] fix: make request optional in all cases (#43) ... 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 --- .../v1alpha/auto_suggestion_service_client.ts | 4 ++-- .../src/v1alpha/question_service_client.ts | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index 764561f4578..40fc9bf0392 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -350,7 +350,7 @@ export class AutoSuggestionServiceClient { // -- Service calls -- // ------------------- suggestQueries( - request: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, + request?: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, options?: CallOptions ): Promise< [ @@ -415,7 +415,7 @@ export class AutoSuggestionServiceClient { * const [response] = await client.suggestQueries(request); */ suggestQueries( - request: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, + request?: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, optionsOrCallback?: | CallOptions | Callback< diff --git a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index c067d33ce57..086c1dcbdce 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -303,7 +303,7 @@ export class QuestionServiceClient { // -- Service calls -- // ------------------- getQuestion( - request: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, + request?: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, options?: CallOptions ): Promise< [ @@ -354,7 +354,7 @@ export class QuestionServiceClient { * const [response] = await client.getQuestion(request); */ getQuestion( - request: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, + request?: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, optionsOrCallback?: | CallOptions | Callback< @@ -397,7 +397,7 @@ export class QuestionServiceClient { return this.innerApiCalls.getQuestion(request, options, callback); } createQuestion( - request: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, + request?: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, options?: CallOptions ): Promise< [ @@ -448,7 +448,7 @@ export class QuestionServiceClient { * const [response] = await client.createQuestion(request); */ createQuestion( - request: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, + request?: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, optionsOrCallback?: | CallOptions | Callback< @@ -491,7 +491,7 @@ export class QuestionServiceClient { return this.innerApiCalls.createQuestion(request, options, callback); } executeQuestion( - request: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, + request?: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, options?: CallOptions ): Promise< [ @@ -542,7 +542,7 @@ export class QuestionServiceClient { * const [response] = await client.executeQuestion(request); */ executeQuestion( - request: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, + request?: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, optionsOrCallback?: | CallOptions | Callback< @@ -585,7 +585,7 @@ export class QuestionServiceClient { return this.innerApiCalls.executeQuestion(request, options, callback); } getUserFeedback( - request: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, + request?: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, options?: CallOptions ): Promise< [ @@ -635,7 +635,7 @@ export class QuestionServiceClient { * const [response] = await client.getUserFeedback(request); */ getUserFeedback( - request: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, + request?: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, optionsOrCallback?: | CallOptions | Callback< @@ -678,7 +678,7 @@ export class QuestionServiceClient { return this.innerApiCalls.getUserFeedback(request, options, callback); } updateUserFeedback( - request: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, + request?: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, options?: CallOptions ): Promise< [ @@ -735,7 +735,7 @@ export class QuestionServiceClient { * const [response] = await client.updateUserFeedback(request); */ updateUserFeedback( - request: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, + request?: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, optionsOrCallback?: | CallOptions | Callback< From 2684ceaa3a9d7974a271aca826f9db0a10116ddb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:48:28 +0000 Subject: [PATCH 25/77] chore: release 1.0.4 (#44) :robot: I have created a release \*beep\* \*boop\* --- ### [1.0.4](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.3...v1.0.4) (2021-06-22) ### Bug Fixes * make request optional in all cases ([#43](https://www.github.com/googleapis/nodejs-data-qna/issues/43)) ([0e4009b](https://www.github.com/googleapis/nodejs-data-qna/commit/0e4009b1fc0d63eed93071df2b9db891977be047)) --- 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-dataqna/CHANGELOG.md | 7 +++++++ packages/google-cloud-dataqna/package.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index 9fd9197450d..dda60b383ea 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.4](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.3...v1.0.4) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#43](https://www.github.com/googleapis/nodejs-data-qna/issues/43)) ([0e4009b](https://www.github.com/googleapis/nodejs-data-qna/commit/0e4009b1fc0d63eed93071df2b9db891977be047)) + ### [1.0.3](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.2...v1.0.3) (2021-05-25) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index c0fc8ea49f2..6e16fbabad4 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "1.0.3", + "version": "1.0.4", "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index 80b5d9aae23..2d41b5835dd 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^1.0.3" + "@google-cloud/data-qna": "^1.0.4" }, "devDependencies": { "c8": "^7.1.0", From b5538ee1dcbf632b66197e8a11e409038d463106 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 29 Jun 2021 11:26:47 -0400 Subject: [PATCH 26/77] fix(deps): google-gax v2.17.0 with mTLS (#50) --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 6e16fbabad4..b4648cc999e 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -40,7 +40,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^2.17.0" }, "devDependencies": { "@types/mocha": "^8.0.4", From fd180bce0b87bb3e222543bd0cbd3da1ca4ef6ed Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 15:50:53 +0000 Subject: [PATCH 27/77] chore: release 1.0.5 (#51) :robot: I have created a release \*beep\* \*boop\* --- ### [1.0.5](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.4...v1.0.5) (2021-06-29) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#50](https://www.github.com/googleapis/nodejs-data-qna/issues/50)) ([458d196](https://www.github.com/googleapis/nodejs-data-qna/commit/458d1966ee8cb9cdbe13357a5cb4f0f7549100df)) --- 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-dataqna/CHANGELOG.md | 7 +++++++ packages/google-cloud-dataqna/package.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index dda60b383ea..d5dbf0c1575 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.5](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.4...v1.0.5) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#50](https://www.github.com/googleapis/nodejs-data-qna/issues/50)) ([458d196](https://www.github.com/googleapis/nodejs-data-qna/commit/458d1966ee8cb9cdbe13357a5cb4f0f7549100df)) + ### [1.0.4](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.3...v1.0.4) (2021-06-22) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index b4648cc999e..0cde833bcb6 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "1.0.4", + "version": "1.0.5", "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index 2d41b5835dd..ab5fe114b55 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^1.0.4" + "@google-cloud/data-qna": "^1.0.5" }, "devDependencies": { "c8": "^7.1.0", From be746540b972db781474a127df0f033a3678cdaa Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 17:48:22 -0400 Subject: [PATCH 28/77] fix(deps): google-gax v2.17.1 (#53) --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 0cde833bcb6..8312971b19f 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -40,7 +40,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.17.0" + "google-gax": "^2.17.1" }, "devDependencies": { "@types/mocha": "^8.0.4", From ee6359148a3d54f4fc508ecb03ac8f593ba90fba 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:32:18 +0000 Subject: [PATCH 29/77] chore: release 1.0.6 (#54) :robot: I have created a release \*beep\* \*boop\* --- ### [1.0.6](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.5...v1.0.6) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#53](https://www.github.com/googleapis/nodejs-data-qna/issues/53)) ([977a8c3](https://www.github.com/googleapis/nodejs-data-qna/commit/977a8c3daf153a2e090a7e29780f498b4ec2ff20)) --- 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-dataqna/CHANGELOG.md | 7 +++++++ packages/google-cloud-dataqna/package.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index d5dbf0c1575..f8c9bcdd16a 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.6](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.5...v1.0.6) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#53](https://www.github.com/googleapis/nodejs-data-qna/issues/53)) ([977a8c3](https://www.github.com/googleapis/nodejs-data-qna/commit/977a8c3daf153a2e090a7e29780f498b4ec2ff20)) + ### [1.0.5](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.4...v1.0.5) (2021-06-29) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 8312971b19f..aba3f9664c2 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "1.0.5", + "version": "1.0.6", "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index ab5fe114b55..078baf4e98b 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^1.0.5" + "@google-cloud/data-qna": "^1.0.6" }, "devDependencies": { "c8": "^7.1.0", From 5a82d160f7f6d3b106a53f6fd680fcfdd0428372 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:10:39 +0000 Subject: [PATCH 30/77] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#55) 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/v1alpha/auto_suggestion_service_client.ts | 11 ++++++++++- .../src/v1alpha/question_service_client.ts | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index 40fc9bf0392..eb269aa7e38 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -104,6 +104,7 @@ const version = require('../../../package.json').version; export class AutoSuggestionServiceClient { 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: {}; @@ -115,6 +116,7 @@ export class AutoSuggestionServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; autoSuggestionServiceStub?: Promise<{[name: string]: Function}>; @@ -159,6 +161,9 @@ export class AutoSuggestionServiceClient { .constructor as typeof AutoSuggestionServiceClient; 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 = @@ -233,6 +238,9 @@ export class AutoSuggestionServiceClient { // 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; } /** @@ -262,7 +270,8 @@ export class AutoSuggestionServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dataqna.v1alpha .AutoSuggestionService, - 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-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index 086c1dcbdce..c28a6d6fa0d 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -53,6 +53,7 @@ const version = require('../../../package.json').version; export class QuestionServiceClient { 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: {}; @@ -64,6 +65,7 @@ export class QuestionServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; questionServiceStub?: Promise<{[name: string]: Function}>; @@ -107,6 +109,9 @@ export class QuestionServiceClient { const staticMembers = this.constructor as typeof QuestionServiceClient; 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 = @@ -181,6 +186,9 @@ export class QuestionServiceClient { // 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; } /** @@ -209,7 +217,8 @@ export class QuestionServiceClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dataqna.v1alpha.QuestionService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From 9dd130ad336545fc48b7f2e010d60bc557c54f89 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 00:22:14 +0000 Subject: [PATCH 31/77] chore: release 1.0.7 (#56) :robot: I have created a release \*beep\* \*boop\* --- ### [1.0.7](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.6...v1.0.7) (2021-07-21) ### Bug Fixes * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#55](https://www.github.com/googleapis/nodejs-data-qna/issues/55)) ([1fd0307](https://www.github.com/googleapis/nodejs-data-qna/commit/1fd0307ddd711128e4e4b31f2b8836095f1588db)) --- 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-dataqna/CHANGELOG.md | 7 +++++++ packages/google-cloud-dataqna/package.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index f8c9bcdd16a..b11e8b44fc0 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.7](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.6...v1.0.7) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#55](https://www.github.com/googleapis/nodejs-data-qna/issues/55)) ([1fd0307](https://www.github.com/googleapis/nodejs-data-qna/commit/1fd0307ddd711128e4e4b31f2b8836095f1588db)) + ### [1.0.6](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.5...v1.0.6) (2021-07-12) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index aba3f9664c2..dbd7903e3f8 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "1.0.6", + "version": "1.0.7", "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index 078baf4e98b..098bb063606 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^1.0.6" + "@google-cloud/data-qna": "^1.0.7" }, "devDependencies": { "c8": "^7.1.0", From 3947ea16b8a6eec9a3cb1738f8f461fca0d04789 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:02:30 -0400 Subject: [PATCH 32/77] chore(nodejs): update client ref docs link in metadata (#61) --- packages/google-cloud-dataqna/.repo-metadata.json | 2 +- packages/google-cloud-dataqna/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/.repo-metadata.json b/packages/google-cloud-dataqna/.repo-metadata.json index 4d1b11c06b8..9126050206f 100644 --- a/packages/google-cloud-dataqna/.repo-metadata.json +++ b/packages/google-cloud-dataqna/.repo-metadata.json @@ -8,7 +8,7 @@ "release_level": "alpha", "distribution_name": "@google-cloud/data-qna", "name": "dataqna", - "client_documentation": "https://googleapis.dev/nodejs/dataqna/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/data-qna/latest", "api_id": "dataqna.googleapis.com", "issue_tracker": "" } diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index 2c5163758af..29caa557a4a 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -115,7 +115,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-data-qna/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/dataqna/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/data-qna/latest [product-docs]: https://cloud.google.com/bigquery/docs [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From a49d111d7a1f90af0a8e39e58ccbb1bdbd9e608d Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Sat, 14 Aug 2021 00:26:08 -0700 Subject: [PATCH 33/77] fix(build): migrate to using main branch (#63) --- packages/google-cloud-dataqna/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index 29caa557a4a..374fe497e77 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -106,8 +106,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 213cf3624577e034aac297b77eee68328ade6fb5 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 16 Aug 2021 22:44:22 -0400 Subject: [PATCH 34/77] fix(deps): google-gax v2.24.1 (#65) --- packages/google-cloud-dataqna/README.md | 8 ++++---- packages/google-cloud-dataqna/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index 374fe497e77..4b6805cae06 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -6,7 +6,7 @@ [![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/@google-cloud/data-qna.svg)](https://www.npmjs.org/package/@google-cloud/data-qna) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-qna/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-qna) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-qna/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-qna) @@ -15,7 +15,7 @@ Dataqna client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-data-qna/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-data-qna/blob/main/CHANGELOG.md). * [Data QnA Node.js Client API Reference][client-docs] * [Data QnA Documentation][product-docs] @@ -101,7 +101,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-data-qna/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-data-qna/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`) @@ -113,7 +113,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-data-qna/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-data-qna/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/data-qna/latest [product-docs]: https://cloud.google.com/bigquery/docs diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index dbd7903e3f8..94d510236e0 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -40,7 +40,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.17.1" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^8.0.4", From 3555b05757186a9b75852f8d11d766624535f7ba 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:30 +0000 Subject: [PATCH 35/77] chore: release 1.0.8 (#64) :robot: I have created a release \*beep\* \*boop\* --- ### [1.0.8](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.7...v1.0.8) (2021-08-17) ### Bug Fixes * **build:** migrate to using main branch ([#63](https://www.github.com/googleapis/nodejs-data-qna/issues/63)) ([1020177](https://www.github.com/googleapis/nodejs-data-qna/commit/1020177e792a4deed38279fc6b9c74601262342f)) * **deps:** google-gax v2.24.1 ([#65](https://www.github.com/googleapis/nodejs-data-qna/issues/65)) ([f298787](https://www.github.com/googleapis/nodejs-data-qna/commit/f2987878347e3d3a1f56b70bb5794aada913f246)) --- 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-dataqna/CHANGELOG.md | 8 ++++++++ packages/google-cloud-dataqna/package.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index b11e8b44fc0..4672af835ca 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.0.8](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.7...v1.0.8) (2021-08-17) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#63](https://www.github.com/googleapis/nodejs-data-qna/issues/63)) ([1020177](https://www.github.com/googleapis/nodejs-data-qna/commit/1020177e792a4deed38279fc6b9c74601262342f)) +* **deps:** google-gax v2.24.1 ([#65](https://www.github.com/googleapis/nodejs-data-qna/issues/65)) ([f298787](https://www.github.com/googleapis/nodejs-data-qna/commit/f2987878347e3d3a1f56b70bb5794aada913f246)) + ### [1.0.7](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.6...v1.0.7) (2021-07-21) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 94d510236e0..99c4fefe313 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "1.0.7", + "version": "1.0.8", "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index 098bb063606..da7936ee9e0 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^1.0.7" + "@google-cloud/data-qna": "^1.0.8" }, "devDependencies": { "c8": "^7.1.0", From 3c308580eb4ebc0ddff764655f401ea645c61a49 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:20:24 +0000 Subject: [PATCH 36/77] feat: turns on self-signed JWT feature flag (#66) - [ ] 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/v1alpha/auto_suggestion_service_client.ts | 6 ++++++ .../src/v1alpha/question_service_client.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index eb269aa7e38..d73eb25b101 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -188,6 +188,12 @@ export class AutoSuggestionServiceClient { // 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-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index c28a6d6fa0d..d4c2009af81 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -136,6 +136,12 @@ export class QuestionServiceClient { // 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 9a36ccf422bd5ddad53bc08d6b75bbbf2cec22e8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 23:34:57 +0000 Subject: [PATCH 37/77] chore: release 1.1.0 (#67) :robot: I have created a release \*beep\* \*boop\* --- ## [1.1.0](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.8...v1.1.0) (2021-09-13) ### Features * turns on self-signed JWT feature flag ([#66](https://www.github.com/googleapis/nodejs-data-qna/issues/66)) ([aa0c29d](https://www.github.com/googleapis/nodejs-data-qna/commit/aa0c29d27dc464fa437ca9f412b162e13ed4531f)) --- 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-dataqna/CHANGELOG.md | 7 +++++++ packages/google-cloud-dataqna/package.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index 4672af835ca..8fba173925c 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.0](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.8...v1.1.0) (2021-09-13) + + +### Features + +* turns on self-signed JWT feature flag ([#66](https://www.github.com/googleapis/nodejs-data-qna/issues/66)) ([aa0c29d](https://www.github.com/googleapis/nodejs-data-qna/commit/aa0c29d27dc464fa437ca9f412b162e13ed4531f)) + ### [1.0.8](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.7...v1.0.8) (2021-08-17) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 99c4fefe313..df084867f1f 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "1.0.8", + "version": "1.1.0", "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index da7936ee9e0..458394109d1 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^1.0.8" + "@google-cloud/data-qna": "^1.1.0" }, "devDependencies": { "c8": "^7.1.0", From 7433affc729eccb8c2f20fcbc3c70f3cf3716bce 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:45:20 +0000 Subject: [PATCH 38/77] build(node): update deps used during postprocessing (#1243) (#76) --- packages/google-cloud-dataqna/protos/protos.d.ts | 3 ++- packages/google-cloud-dataqna/protos/protos.js | 7 +++++++ packages/google-cloud-dataqna/protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/protos/protos.d.ts b/packages/google-cloud-dataqna/protos/protos.d.ts index f77b2e6d8df..9ce74b77d83 100644 --- a/packages/google-cloud-dataqna/protos/protos.d.ts +++ b/packages/google-cloud-dataqna/protos/protos.d.ts @@ -3397,7 +3397,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-dataqna/protos/protos.js b/packages/google-cloud-dataqna/protos/protos.js index 015cdb5b67a..9d15bd463ca 100644 --- a/packages/google-cloud-dataqna/protos/protos.js +++ b/packages/google-cloud-dataqna/protos/protos.js @@ -8349,6 +8349,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); @@ -8359,6 +8360,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; })(); @@ -14527,6 +14529,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -14631,6 +14634,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-dataqna/protos/protos.json b/packages/google-cloud-dataqna/protos/protos.json index 5726f2f2546..e76b42bbb21 100644 --- a/packages/google-cloud-dataqna/protos/protos.json +++ b/packages/google-cloud-dataqna/protos/protos.json @@ -844,7 +844,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "resourceReference": { @@ -1503,6 +1504,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From 32935c36782136dceed8406ba119896c05f17a3d Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 27 Oct 2021 11:24:40 -0700 Subject: [PATCH 39/77] chore: fix the wrong post processor image (#78) --- packages/google-cloud-dataqna/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/.github/.OwlBot.yaml b/packages/google-cloud-dataqna/.github/.OwlBot.yaml index 03a556dba80..43db43f58d0 100644 --- a/packages/google-cloud-dataqna/.github/.OwlBot.yaml +++ b/packages/google-cloud-dataqna/.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 cb63db0bbb1ab47d904a1835a8bba81afcf80f1a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Oct 2021 21:10:24 +0200 Subject: [PATCH 40/77] chore(deps): update dependency @types/node to v16 (#77) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^14.14.10` -> `^16.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/14.17.32/16.11.6) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/compatibility-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/confidence-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index df084867f1f..60630e5ed76 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -44,7 +44,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.4", - "@types/node": "^14.14.10", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.3.5", "gts": "^3.0.3", From a50a88b17425572f42a3a0020ccb57a60f0ffea2 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 3 Nov 2021 13:54:23 -0400 Subject: [PATCH 41/77] chore(cloud-rad): delete api-extractor config (#79) --- .../google-cloud-dataqna/api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-dataqna/api-extractor.json diff --git a/packages/google-cloud-dataqna/api-extractor.json b/packages/google-cloud-dataqna/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-dataqna/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 d72a9bb15a99373193ef6ecec087a701f5aede3a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:42:25 +0100 Subject: [PATCH 42/77] chore(deps): update dependency sinon to v12 (#80) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^11.0.0` -> `^12.0.0`](https://renovatebot.com/diffs/npm/sinon/11.1.2/12.0.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/compatibility-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/confidence-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v12.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGES.md#​1201) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.0...v12.0.1) - [`3f598221`](https://togithub.com/sinonjs/sinon/commit/3f598221045904681f2b3b3ba1df617ed5e230e3) Fix issue with npm unlink for npm version > 6 (Carl-Erik Kopseng) > 'npm unlink' would implicitly unlink the current dir > until version 7, which requires an argument - [`51417a38`](https://togithub.com/sinonjs/sinon/commit/51417a38111eeeb7cd14338bfb762cc2df487e1b) Fix bundling of cjs module ([#​2412](https://togithub.com/sinonjs/sinon/issues/2412)) (Julian Grinblat) > - Fix bundling of cjs module > > - Run prettier *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2021-11-04.* #### 12.0.0 ### [`v12.0.0`](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 60630e5ed76..519a0a6d0f6 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -55,7 +55,7 @@ "mocha": "^8.2.1", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^11.0.0", + "sinon": "^12.0.0", "ts-loader": "^9.0.0", "typescript": "^4.1.2", "webpack": "^5.9.0", From 424071fa35f39fe3e505f6b85ee69fc9afc9542a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:13:39 -0800 Subject: [PATCH 43/77] docs(samples): add example tags to generated samples (#81) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(samples): add example tags to generated samples PiperOrigin-RevId: 408439482 Source-Link: https://github.com/googleapis/googleapis/commit/b9f61843dc80c7c285fc34fd3a40aae55082c2b9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../linkinator.config.json | 2 +- ...auto_suggestion_service.suggest_queries.js | 75 +++++++ .../question_service.create_question.js | 58 +++++ .../question_service.execute_question.js | 58 +++++ .../v1alpha/question_service.get_question.js | 57 +++++ .../question_service.get_user_feedback.js | 54 +++++ .../question_service.update_user_feedback.js | 59 +++++ .../v1alpha/auto_suggestion_service_client.ts | 66 +++--- .../src/v1alpha/question_service_client.ts | 204 +++++++++--------- 9 files changed, 497 insertions(+), 136 deletions(-) create mode 100644 packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js create mode 100644 packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js create mode 100644 packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js create mode 100644 packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js create mode 100644 packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js create mode 100644 packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js diff --git a/packages/google-cloud-dataqna/linkinator.config.json b/packages/google-cloud-dataqna/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-dataqna/linkinator.config.json +++ b/packages/google-cloud-dataqna/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js new file mode 100644 index 00000000000..d81f4c3d901 --- /dev/null +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js @@ -0,0 +1,75 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START dataqna_v1alpha_generated_AutoSuggestionService_SuggestQueries_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent of the suggestion query is the resource denoting the project and + * location. + */ + // const parent = 'abc123' + /** + * The scopes to which this search is restricted. The only supported scope + * pattern is + * `//bigquery.googleapis.com/projects/{GCP-PROJECT-ID}/datasets/{DATASET-ID}/tables/{TABLE-ID}`. + */ + // const scopes = 'abc123' + /** + * User query for which to generate suggestions. If the query is empty, zero + * state suggestions are returned. This allows UIs to display suggestions + * right away, helping the user to get a sense of what a query might look + * like. + */ + // const query = 'abc123' + /** + * The requested suggestion type. Multiple suggestion types can be + * requested, but there is no guarantee that the service will return + * suggestions for each type. Suggestions for a requested type might rank + * lower than suggestions for other types and the service may decide to cut + * these suggestions off. + */ + // const suggestionTypes = 1234 + + // Imports the Dataqna library + const {AutoSuggestionServiceClient} = + require('@google-cloud/data-qna').v1alpha; + + // Instantiates a client + const dataqnaClient = new AutoSuggestionServiceClient(); + + async function callSuggestQueries() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await dataqnaClient.suggestQueries(request); + console.log(response); + } + + callSuggestQueries(); + // [END dataqna_v1alpha_generated_AutoSuggestionService_SuggestQueries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js new file mode 100644 index 00000000000..134528b4f04 --- /dev/null +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.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(parent, question) { + // [START dataqna_v1alpha_generated_QuestionService_CreateQuestion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project this data source reference belongs to. + * Example: `projects/foo/locations/bar` + */ + // const parent = 'abc123' + /** + * Required. The question to create. + */ + // const question = {} + + // Imports the Dataqna library + const {QuestionServiceClient} = require('@google-cloud/data-qna').v1alpha; + + // Instantiates a client + const dataqnaClient = new QuestionServiceClient(); + + async function callCreateQuestion() { + // Construct request + const request = { + parent, + question, + }; + + // Run request + const response = await dataqnaClient.createQuestion(request); + console.log(response); + } + + callCreateQuestion(); + // [END dataqna_v1alpha_generated_QuestionService_CreateQuestion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js new file mode 100644 index 00000000000..53b93d8153e --- /dev/null +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.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(name, interpretationIndex) { + // [START dataqna_v1alpha_generated_QuestionService_ExecuteQuestion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique identifier for the question. + * Example: `projects/foo/locations/bar/questions/1234` + */ + // const name = 'abc123' + /** + * Required. Index of the interpretation to execute. + */ + // const interpretationIndex = 1234 + + // Imports the Dataqna library + const {QuestionServiceClient} = require('@google-cloud/data-qna').v1alpha; + + // Instantiates a client + const dataqnaClient = new QuestionServiceClient(); + + async function callExecuteQuestion() { + // Construct request + const request = { + name, + interpretationIndex, + }; + + // Run request + const response = await dataqnaClient.executeQuestion(request); + console.log(response); + } + + callExecuteQuestion(); + // [END dataqna_v1alpha_generated_QuestionService_ExecuteQuestion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js new file mode 100644 index 00000000000..25431f8fe2b --- /dev/null +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START dataqna_v1alpha_generated_QuestionService_GetQuestion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique identifier for the question. + * Example: `projects/foo/locations/bar/questions/1234` + */ + // const name = 'abc123' + /** + * The list of fields to be retrieved. + */ + // const readMask = {} + + // Imports the Dataqna library + const {QuestionServiceClient} = require('@google-cloud/data-qna').v1alpha; + + // Instantiates a client + const dataqnaClient = new QuestionServiceClient(); + + async function callGetQuestion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataqnaClient.getQuestion(request); + console.log(response); + } + + callGetQuestion(); + // [END dataqna_v1alpha_generated_QuestionService_GetQuestion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js new file mode 100644 index 00000000000..b9bb73b8e55 --- /dev/null +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.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 dataqna_v1alpha_generated_QuestionService_GetUserFeedback_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique identifier for the user feedback. + * User feedback is a singleton resource on a Question. + * Example: `projects/foo/locations/bar/questions/1234/userFeedback` + */ + // const name = 'abc123' + + // Imports the Dataqna library + const {QuestionServiceClient} = require('@google-cloud/data-qna').v1alpha; + + // Instantiates a client + const dataqnaClient = new QuestionServiceClient(); + + async function callGetUserFeedback() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataqnaClient.getUserFeedback(request); + console.log(response); + } + + callGetUserFeedback(); + // [END dataqna_v1alpha_generated_QuestionService_GetUserFeedback_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js new file mode 100644 index 00000000000..6ada7b45b33 --- /dev/null +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.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(userFeedback) { + // [START dataqna_v1alpha_generated_QuestionService_UpdateUserFeedback_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The user feedback to update. This can be called even if there is no + * user feedback so far. + * The feedback's name field is used to identify the user feedback (and the + * corresponding question) to update. + */ + // const userFeedback = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Dataqna library + const {QuestionServiceClient} = require('@google-cloud/data-qna').v1alpha; + + // Instantiates a client + const dataqnaClient = new QuestionServiceClient(); + + async function callUpdateUserFeedback() { + // Construct request + const request = { + userFeedback, + }; + + // Run request + const response = await dataqnaClient.updateUserFeedback(request); + console.log(response); + } + + callUpdateUserFeedback(); + // [END dataqna_v1alpha_generated_QuestionService_UpdateUserFeedback_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index d73eb25b101..d0e16972985 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -364,37 +364,6 @@ export class AutoSuggestionServiceClient { // ------------------- // -- Service calls -- // ------------------- - suggestQueries( - request?: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, - protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest | undefined, - {} | undefined - ] - >; - suggestQueries( - request: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, - | protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest - | null - | undefined, - {} | null | undefined - > - ): void; - suggestQueries( - request: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, - callback: Callback< - protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, - | protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Gets a list of suggestions based on a prefix string. * AutoSuggestion tolerance should be less than 1 second. @@ -426,9 +395,40 @@ export class AutoSuggestionServiceClient { * 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.suggestQueries(request); + * @example include:samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js + * region_tag:dataqna_v1alpha_generated_AutoSuggestionService_SuggestQueries_async */ + suggestQueries( + request?: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest | undefined, + {} | undefined + ] + >; + suggestQueries( + request: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, + | protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + suggestQueries( + request: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, + callback: Callback< + protos.google.cloud.dataqna.v1alpha.ISuggestQueriesResponse, + | protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest + | null + | undefined, + {} | null | undefined + > + ): void; suggestQueries( request?: protos.google.cloud.dataqna.v1alpha.ISuggestQueriesRequest, optionsOrCallback?: diff --git a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index d4c2009af81..05c95d7cd25 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -317,6 +317,26 @@ export class QuestionServiceClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets a previously created question. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique identifier for the question. + * Example: `projects/foo/locations/bar/questions/1234` + * @param {google.protobuf.FieldMask} request.readMask + * The list of fields to be retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Question]{@link google.cloud.dataqna.v1alpha.Question}. + * 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/v1alpha/question_service.get_question.js + * region_tag:dataqna_v1alpha_generated_QuestionService_GetQuestion_async + */ getQuestion( request?: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, options?: CallOptions @@ -348,26 +368,6 @@ export class QuestionServiceClient { {} | null | undefined > ): void; - /** - * Gets a previously created question. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique identifier for the question. - * Example: `projects/foo/locations/bar/questions/1234` - * @param {google.protobuf.FieldMask} request.readMask - * The list of fields to be retrieved. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Question]{@link google.cloud.dataqna.v1alpha.Question}. - * 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.getQuestion(request); - */ getQuestion( request?: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, optionsOrCallback?: @@ -411,6 +411,26 @@ export class QuestionServiceClient { this.initialize(); return this.innerApiCalls.getQuestion(request, options, callback); } + /** + * Creates a question. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project this data source reference belongs to. + * Example: `projects/foo/locations/bar` + * @param {google.cloud.dataqna.v1alpha.Question} request.question + * Required. The question to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Question]{@link google.cloud.dataqna.v1alpha.Question}. + * 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/v1alpha/question_service.create_question.js + * region_tag:dataqna_v1alpha_generated_QuestionService_CreateQuestion_async + */ createQuestion( request?: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, options?: CallOptions @@ -442,26 +462,6 @@ export class QuestionServiceClient { {} | null | undefined > ): void; - /** - * Creates a question. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project this data source reference belongs to. - * Example: `projects/foo/locations/bar` - * @param {google.cloud.dataqna.v1alpha.Question} request.question - * Required. The question to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Question]{@link google.cloud.dataqna.v1alpha.Question}. - * 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.createQuestion(request); - */ createQuestion( request?: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, optionsOrCallback?: @@ -505,6 +505,26 @@ export class QuestionServiceClient { this.initialize(); return this.innerApiCalls.createQuestion(request, options, callback); } + /** + * Executes an interpretation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique identifier for the question. + * Example: `projects/foo/locations/bar/questions/1234` + * @param {number} request.interpretationIndex + * Required. Index of the interpretation to execute. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Question]{@link google.cloud.dataqna.v1alpha.Question}. + * 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/v1alpha/question_service.execute_question.js + * region_tag:dataqna_v1alpha_generated_QuestionService_ExecuteQuestion_async + */ executeQuestion( request?: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, options?: CallOptions @@ -536,26 +556,6 @@ export class QuestionServiceClient { {} | null | undefined > ): void; - /** - * Executes an interpretation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique identifier for the question. - * Example: `projects/foo/locations/bar/questions/1234` - * @param {number} request.interpretationIndex - * Required. Index of the interpretation to execute. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Question]{@link google.cloud.dataqna.v1alpha.Question}. - * 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.executeQuestion(request); - */ executeQuestion( request?: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, optionsOrCallback?: @@ -599,6 +599,25 @@ export class QuestionServiceClient { this.initialize(); return this.innerApiCalls.executeQuestion(request, options, callback); } + /** + * Gets previously created user feedback. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique identifier for the user feedback. + * User feedback is a singleton resource on a Question. + * Example: `projects/foo/locations/bar/questions/1234/userFeedback` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [UserFeedback]{@link google.cloud.dataqna.v1alpha.UserFeedback}. + * 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/v1alpha/question_service.get_user_feedback.js + * region_tag:dataqna_v1alpha_generated_QuestionService_GetUserFeedback_async + */ getUserFeedback( request?: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, options?: CallOptions @@ -630,25 +649,6 @@ export class QuestionServiceClient { {} | null | undefined > ): void; - /** - * Gets previously created user feedback. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique identifier for the user feedback. - * User feedback is a singleton resource on a Question. - * Example: `projects/foo/locations/bar/questions/1234/userFeedback` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [UserFeedback]{@link google.cloud.dataqna.v1alpha.UserFeedback}. - * 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.getUserFeedback(request); - */ getUserFeedback( request?: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, optionsOrCallback?: @@ -692,6 +692,29 @@ export class QuestionServiceClient { this.initialize(); return this.innerApiCalls.getUserFeedback(request, options, callback); } + /** + * Updates user feedback. This creates user feedback if there was none before + * (upsert). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dataqna.v1alpha.UserFeedback} request.userFeedback + * Required. The user feedback to update. This can be called even if there is no + * user feedback so far. + * The feedback's name field is used to identify the user feedback (and the + * corresponding question) to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to 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 [UserFeedback]{@link google.cloud.dataqna.v1alpha.UserFeedback}. + * 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/v1alpha/question_service.update_user_feedback.js + * region_tag:dataqna_v1alpha_generated_QuestionService_UpdateUserFeedback_async + */ updateUserFeedback( request?: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, options?: CallOptions @@ -726,29 +749,6 @@ export class QuestionServiceClient { {} | null | undefined > ): void; - /** - * Updates user feedback. This creates user feedback if there was none before - * (upsert). - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dataqna.v1alpha.UserFeedback} request.userFeedback - * Required. The user feedback to update. This can be called even if there is no - * user feedback so far. - * The feedback's name field is used to identify the user feedback (and the - * corresponding question) to update. - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to 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 [UserFeedback]{@link google.cloud.dataqna.v1alpha.UserFeedback}. - * 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.updateUserFeedback(request); - */ updateUserFeedback( request?: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, optionsOrCallback?: From 97184095480b8e0e2b657fa42c6f78d378b84d14 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 10 Dec 2021 21:14:13 +0000 Subject: [PATCH 44/77] build: add generated samples to .eslintignore (#82) --- packages/google-cloud-dataqna/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-dataqna/.eslintignore b/packages/google-cloud-dataqna/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-dataqna/.eslintignore +++ b/packages/google-cloud-dataqna/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From af7a49b12de133be3107dfe11d3e18dc5a259385 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Dec 2021 21:38:25 +0000 Subject: [PATCH 45/77] docs(node): support "stable"/"preview" release level (#1312) (#85) --- packages/google-cloud-dataqna/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index 4b6805cae06..05ec5f4e98d 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -89,12 +89,14 @@ 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 From 5a0e334f9c59397d92ddfc4554bd19d57e11c5b7 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:18:27 +0000 Subject: [PATCH 46/77] docs(badges): tweak badge to use new preview/stable language (#1314) (#86) --- packages/google-cloud-dataqna/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index 05ec5f4e98d..da6da55d79f 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -6,7 +6,6 @@ [![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/@google-cloud/data-qna.svg)](https://www.npmjs.org/package/@google-cloud/data-qna) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-qna/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-qna) From df5e65346df466cd23de823cc5a76f3c4a684c5d Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Dec 2021 19:04:14 -0500 Subject: [PATCH 47/77] chore: add api_shortname and library_type to repo metadata (#84) Update .repo-metadata.json as required by go/library-data-integrity --- packages/google-cloud-dataqna/.repo-metadata.json | 6 ++++-- packages/google-cloud-dataqna/README.md | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-dataqna/.repo-metadata.json b/packages/google-cloud-dataqna/.repo-metadata.json index 9126050206f..9964a6e9977 100644 --- a/packages/google-cloud-dataqna/.repo-metadata.json +++ b/packages/google-cloud-dataqna/.repo-metadata.json @@ -5,10 +5,12 @@ "repo": "googleapis/nodejs-data-qna", "default_version": "v1alpha", "name_pretty": "Data QnA", - "release_level": "alpha", + "release_level": "preview", "distribution_name": "@google-cloud/data-qna", "name": "dataqna", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/data-qna/latest", "api_id": "dataqna.googleapis.com", - "issue_tracker": "" + "issue_tracker": "https://github.com/googleapis/nodejs-data-qna/issues", + "api_shortname": "dataqna", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index da6da55d79f..03da4ea9aa7 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -4,7 +4,7 @@ # [Data QnA: Node.js Client](https://github.com/googleapis/nodejs-data-qna) -[![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-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/data-qna.svg)](https://www.npmjs.org/package/@google-cloud/data-qna) @@ -89,11 +89,11 @@ 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. +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. More Information: [Google Cloud Platform Launch Stages][launch_stages] From ba96bff9330594bac05020697ffb4e72f2367f15 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 13 Jan 2022 11:40:44 -0500 Subject: [PATCH 48/77] test(nodejs): remove 15 add 16 (#1322) (#88) Source-Link: https://github.com/googleapis/synthtool/commit/6981da4f29c0ae3dd783d58f1be5ab222d6a5642 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:3563b6b264989c4f5aa31a3682e4df36c95756cfef275d3201508947cbfc511e Co-authored-by: Owl Bot --- packages/google-cloud-dataqna/protos/protos.d.ts | 2 +- packages/google-cloud-dataqna/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-dataqna/protos/protos.d.ts b/packages/google-cloud-dataqna/protos/protos.d.ts index 9ce74b77d83..b6d92e180e9 100644 --- a/packages/google-cloud-dataqna/protos/protos.d.ts +++ b/packages/google-cloud-dataqna/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-dataqna/protos/protos.js b/packages/google-cloud-dataqna/protos/protos.js index 9d15bd463ca..6eae39bbd31 100644 --- a/packages/google-cloud-dataqna/protos/protos.js +++ b/packages/google-cloud-dataqna/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 3d75696cb7052ebccf04e0afd4e57678098afbce 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:58:30 +0000 Subject: [PATCH 49/77] chore: update v2.12.0 gapic-generator-typescript (#92) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 424244721 Source-Link: https://github.com/googleapis/googleapis/commit/4b6b01f507ebc3df95fdf8e1d76b0ae0ae33e52c Source-Link: https://github.com/googleapis/googleapis-gen/commit/8ac83fba606d008c7e8a42e7d55b6596ec4be35f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGFjODNmYmE2MDZkMDA4YzdlOGE0MmU3ZDU1YjY1OTZlYzRiZTM1ZiJ9 --- packages/google-cloud-dataqna/.jsdoc.js | 4 ++-- packages/google-cloud-dataqna/linkinator.config.json | 10 ++++++++-- .../v1alpha/auto_suggestion_service.suggest_queries.js | 4 ++-- .../v1alpha/question_service.create_question.js | 1 + .../v1alpha/question_service.execute_question.js | 1 + .../generated/v1alpha/question_service.get_question.js | 1 + .../v1alpha/question_service.get_user_feedback.js | 1 + .../v1alpha/question_service.update_user_feedback.js | 1 + .../src/v1alpha/auto_suggestion_service_client.ts | 2 +- packages/google-cloud-dataqna/src/v1alpha/index.ts | 2 +- .../src/v1alpha/question_service_client.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-dataqna/system-test/install.ts | 2 +- .../test/gapic_auto_suggestion_service_v1alpha.ts | 2 +- .../test/gapic_question_service_v1alpha.ts | 2 +- 16 files changed, 25 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-dataqna/.jsdoc.js b/packages/google-cloud-dataqna/.jsdoc.js index e1f30aa716b..644dffa71cd 100644 --- a/packages/google-cloud-dataqna/.jsdoc.js +++ b/packages/google-cloud-dataqna/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2021 Google LLC', + copyright: 'Copyright 2022 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/data-qna', diff --git a/packages/google-cloud-dataqna/linkinator.config.json b/packages/google-cloud-dataqna/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-dataqna/linkinator.config.json +++ b/packages/google-cloud-dataqna/linkinator.config.json @@ -3,8 +3,14 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" ], "silent": true, - "concurrency": 5 + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 } diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js index d81f4c3d901..e48309b1411 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -47,8 +48,7 @@ function main(parent) { // const suggestionTypes = 1234 // Imports the Dataqna library - const {AutoSuggestionServiceClient} = - require('@google-cloud/data-qna').v1alpha; + const {AutoSuggestionServiceClient} = require('@google-cloud/data-qna').v1alpha; // Instantiates a client const dataqnaClient = new AutoSuggestionServiceClient(); diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js index 134528b4f04..728c19400f0 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, question) { diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js index 53b93d8153e..306d954a203 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, interpretationIndex) { diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js index 25431f8fe2b..a68a78141f2 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js index b9bb73b8e55..92fad8c1e77 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js index 6ada7b45b33..bd8155004a9 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(userFeedback) { diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index d0e16972985..7443d458f2f 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_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-dataqna/src/v1alpha/index.ts b/packages/google-cloud-dataqna/src/v1alpha/index.ts index 9de71b5c8d2..f1a92ecacd6 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/index.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/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-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index 05c95d7cd25..489b4ce9255 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_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-dataqna/system-test/fixtures/sample/src/index.js b/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.js index dd48c391861..23dd45780f1 100644 --- a/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-dataqna/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-dataqna/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.ts index f331e6d3a8a..4f8307453e2 100644 --- a/packages/google-cloud-dataqna/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-dataqna/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-dataqna/system-test/install.ts b/packages/google-cloud-dataqna/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-dataqna/system-test/install.ts +++ b/packages/google-cloud-dataqna/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-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts index 40e117d6077..2b7212532e7 100644 --- a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.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-dataqna/test/gapic_question_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts index d5ee47dbc3f..c420d42f524 100644 --- a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.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 60872e7aff6c9e83ef37f29e3de8924e9933bd1f 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:26:54 +0000 Subject: [PATCH 50/77] docs(nodejs): version support policy edits (#1346) (#96) --- packages/google-cloud-dataqna/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index 03da4ea9aa7..a8a1be5f2d4 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -65,21 +65,21 @@ also contains samples. Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). Libraries are compatible with all current _active_ and _maintenance_ versions of Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. - -_Legacy Node.js versions are supported as a best effort:_ +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: -* Legacy versions will not be tested in continuous integration. -* Some security patches may not be able to be backported. -* Dependencies will not be kept up-to-date, and features will not be backported. +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. -#### Legacy tags available - -* `legacy-8`: install client libraries from this dist-tag for versions - compatible with Node.js 8. +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/data-qna@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From 06ef14954632572cb36dd37e80c77d8cf8af279d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 5 Feb 2022 18:39:07 +0100 Subject: [PATCH 51/77] chore(deps): update dependency sinon to v13 (#94) 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.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/compatibility-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/confidence-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v13.0.1`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1301) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v13.0.0...v13.0.1) - [`ec4223f9`](https://togithub.com/sinonjs/sinon/commit/ec4223f94076d809483e3c6a7536cfc1278dd3c9) Bump nise to fix [sinonjs/nise#​193](https://togithub.com/sinonjs/nise/issues/193) (Carl-Erik Kopseng) - [`f329a010`](https://togithub.com/sinonjs/sinon/commit/f329a01040bfa5a79e039419220b21eda56935d6) Add unimported to workflow ([#​2441](https://togithub.com/sinonjs/sinon/issues/2441)) (Morgan Roderick) - [`7f16cec9`](https://togithub.com/sinonjs/sinon/commit/7f16cec968c3c8d4e580267fb00195916d6f827d) Enable updates to same major version (Carl-Erik Kopseng) - [`f784d7ad`](https://togithub.com/sinonjs/sinon/commit/f784d7ad2c86be0fc65477d69f8bdafca846ef2c) Re-introduce new version.sh script to version hook (Joel Bradshaw) > This was inadvertently removed during merge conflicts, and is required > for any of the new release process stuff to work - [`51c508ab`](https://togithub.com/sinonjs/sinon/commit/51c508ab77cf0f9fb8c5305ff626f6a2eada178f) Add dry run mode to `npm version` ([#​2436](https://togithub.com/sinonjs/sinon/issues/2436)) (Joel Bradshaw) > - Add DRY_RUN flag to skip publish/push > > - Allow overriding branch names for testing - [`05341dcf`](https://togithub.com/sinonjs/sinon/commit/05341dcf92ddca4a1d4c90966b1fcdc7039cff18) Update npm version scripts to manage new releases branch (Joel Bradshaw) - [`fe658261`](https://togithub.com/sinonjs/sinon/commit/fe65826171db69ed2986a1060db77944dbc98a6d) Remove release archives from master (Joel Bradshaw) > These archives made it difficult to find things in the GitHub interface, > and take up a lot of space in a checked-out repo for something that is > not useful to most people checking out the repository. > > The main purpose of these archives is to make old versions and > documentation available on the Sinon website that is run out of this > repo. This can be supported by using a separate branch for website > releases, and to maintain the archives. > > Following this commit, the `npm version` scripts will be updated to > automatically handle archiving the releases in the new releases branch > and keeping it up to date with master. > > Also remove the directories we removed from .prettierignore, since they > don't exist any more. *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2022-02-01.* ### [`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-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 519a0a6d0f6..124d582902f 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -55,7 +55,7 @@ "mocha": "^8.2.1", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^12.0.0", + "sinon": "^13.0.0", "ts-loader": "^9.0.0", "typescript": "^4.1.2", "webpack": "^5.9.0", From 5f703387795fccdd1f17c1393ba547989576f424 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:53 +0000 Subject: [PATCH 52/77] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#97) - [ ] 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 --- ...auto_suggestion_service.suggest_queries.js | 9 +- .../question_service.create_question.js | 9 +- .../question_service.execute_question.js | 9 +- .../v1alpha/question_service.get_question.js | 9 +- .../question_service.get_user_feedback.js | 9 +- .../question_service.update_user_feedback.js | 9 +- ...metadata.google.cloud.dataqna.v1alpha.json | 283 ++++++++++++++++++ .../v1alpha/auto_suggestion_service_client.ts | 5 +- .../src/v1alpha/question_service_client.ts | 5 +- .../gapic_auto_suggestion_service_v1alpha.ts | 37 ++- .../test/gapic_question_service_v1alpha.ts | 100 ++++++- 11 files changed, 462 insertions(+), 22 deletions(-) create mode 100644 packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js index e48309b1411..5ad8c62cadc 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.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-dataqna/samples/generated/v1alpha/question_service.create_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js index 728c19400f0..b5ecc9a0d65 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.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-dataqna/samples/generated/v1alpha/question_service.execute_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js index 306d954a203..7622a04c69e 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.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-dataqna/samples/generated/v1alpha/question_service.get_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js index a68a78141f2..7402a695a7b 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.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-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js index 92fad8c1e77..58bb01bb9da 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.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-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js index bd8155004a9..00ed986dbb6 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.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-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json new file mode 100644 index 00000000000..0691eddcd06 --- /dev/null +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json @@ -0,0 +1,283 @@ +{ + "clientLibrary": { + "name": "nodejs-dataqna", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.dataqna.v1alpha", + "version": "v1alpha" + } + ] + }, + "snippets": [ + { + "regionTag": "dataqna_v1alpha_generated_AutoSuggestionService_SuggestQueries_async", + "title": "AutoSuggestionService suggestQueries Sample", + "origin": "API_DEFINITION", + "description": " Gets a list of suggestions based on a prefix string. AutoSuggestion tolerance should be less than 1 second.", + "canonical": true, + "file": "auto_suggestion_service.suggest_queries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SuggestQueries", + "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionService.SuggestQueries", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "scopes", + "type": "TYPE_STRING[]" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "suggestion_types", + "type": "TYPE_ENUM[]" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.SuggestQueriesResponse", + "client": { + "shortName": "AutoSuggestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionServiceClient" + }, + "method": { + "shortName": "SuggestQueries", + "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionService.SuggestQueries", + "service": { + "shortName": "AutoSuggestionService", + "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionService" + } + } + } + }, + { + "regionTag": "dataqna_v1alpha_generated_QuestionService_GetQuestion_async", + "title": "AutoSuggestionService getQuestion Sample", + "origin": "API_DEFINITION", + "description": " Gets a previously created question.", + "canonical": true, + "file": "question_service.get_question.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetQuestion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "read_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.Question", + "client": { + "shortName": "QuestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + }, + "method": { + "shortName": "GetQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetQuestion", + "service": { + "shortName": "QuestionService", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService" + } + } + } + }, + { + "regionTag": "dataqna_v1alpha_generated_QuestionService_CreateQuestion_async", + "title": "AutoSuggestionService createQuestion Sample", + "origin": "API_DEFINITION", + "description": " Creates a question.", + "canonical": true, + "file": "question_service.create_question.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.CreateQuestion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "question", + "type": ".google.cloud.dataqna.v1alpha.Question" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.Question", + "client": { + "shortName": "QuestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + }, + "method": { + "shortName": "CreateQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.CreateQuestion", + "service": { + "shortName": "QuestionService", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService" + } + } + } + }, + { + "regionTag": "dataqna_v1alpha_generated_QuestionService_ExecuteQuestion_async", + "title": "AutoSuggestionService executeQuestion Sample", + "origin": "API_DEFINITION", + "description": " Executes an interpretation.", + "canonical": true, + "file": "question_service.execute_question.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExecuteQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.ExecuteQuestion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "interpretation_index", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.Question", + "client": { + "shortName": "QuestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + }, + "method": { + "shortName": "ExecuteQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.ExecuteQuestion", + "service": { + "shortName": "QuestionService", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService" + } + } + } + }, + { + "regionTag": "dataqna_v1alpha_generated_QuestionService_GetUserFeedback_async", + "title": "AutoSuggestionService getUserFeedback Sample", + "origin": "API_DEFINITION", + "description": " Gets previously created user feedback.", + "canonical": true, + "file": "question_service.get_user_feedback.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUserFeedback", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetUserFeedback", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.UserFeedback", + "client": { + "shortName": "QuestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + }, + "method": { + "shortName": "GetUserFeedback", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetUserFeedback", + "service": { + "shortName": "QuestionService", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService" + } + } + } + }, + { + "regionTag": "dataqna_v1alpha_generated_QuestionService_UpdateUserFeedback_async", + "title": "AutoSuggestionService updateUserFeedback Sample", + "origin": "API_DEFINITION", + "description": " Updates user feedback. This creates user feedback if there was none before (upsert).", + "canonical": true, + "file": "question_service.update_user_feedback.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUserFeedback", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.UpdateUserFeedback", + "async": true, + "parameters": [ + { + "name": "user_feedback", + "type": ".google.cloud.dataqna.v1alpha.UserFeedback" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.UserFeedback", + "client": { + "shortName": "QuestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + }, + "method": { + "shortName": "UpdateUserFeedback", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.UpdateUserFeedback", + "service": { + "shortName": "QuestionService", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index 7443d458f2f..59613b73b50 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -621,9 +621,8 @@ export class AutoSuggestionServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.autoSuggestionServiceStub!.then(stub => { + if (this.autoSuggestionServiceStub && !this._terminated) { + return this.autoSuggestionServiceStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index 489b4ce9255..c5f9c834923 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -944,9 +944,8 @@ export class QuestionServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.questionServiceStub!.then(stub => { + if (this.questionServiceStub && !this._terminated) { + return this.questionServiceStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts index 2b7212532e7..9f88eefaf73 100644 --- a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts @@ -96,13 +96,29 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { assert(client.autoSuggestionServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.autoSuggestionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoSuggestionServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -253,6 +269,23 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes suggestQueries with closed client', async () => { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.suggestQueries(request), expectedError); + }); }); describe('Path templates', () => { diff --git a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts index c420d42f524..e429c8de2a1 100644 --- a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts @@ -90,12 +90,27 @@ describe('v1alpha.QuestionServiceClient', () => { assert(client.questionServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new questionserviceModule.v1alpha.QuestionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.questionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.questionServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -241,6 +256,22 @@ describe('v1alpha.QuestionServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getQuestion with closed client', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getQuestion(request), expectedError); + }); }); describe('createQuestion', () => { @@ -352,6 +383,22 @@ describe('v1alpha.QuestionServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createQuestion with closed client', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createQuestion(request), expectedError); + }); }); describe('executeQuestion', () => { @@ -463,6 +510,22 @@ describe('v1alpha.QuestionServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes executeQuestion with closed client', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.executeQuestion(request), expectedError); + }); }); describe('getUserFeedback', () => { @@ -574,6 +637,22 @@ describe('v1alpha.QuestionServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getUserFeedback with closed client', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getUserFeedback(request), expectedError); + }); }); describe('updateUserFeedback', () => { @@ -689,6 +768,23 @@ describe('v1alpha.QuestionServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateUserFeedback with closed client', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() + ); + request.userFeedback = {}; + request.userFeedback.name = ''; + const expectedHeaderRequestParams = 'user_feedback.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateUserFeedback(request), expectedError); + }); }); describe('Path templates', () => { From 9269fcb0b4a3866980a6f20e8573680848813a45 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 16 Mar 2022 21:36:31 +0000 Subject: [PATCH 53/77] chore: update v2.14.2 gapic-generator-typescript (#101) - [ ] 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_auto_suggestion_service_v1alpha.ts | 1 - .../test/gapic_question_service_v1alpha.ts | 5 ----- 2 files changed, 6 deletions(-) diff --git a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts index 9f88eefaf73..92225909c0b 100644 --- a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts @@ -281,7 +281,6 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.suggestQueries(request), expectedError); diff --git a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts index e429c8de2a1..ea232a3419b 100644 --- a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts @@ -267,7 +267,6 @@ describe('v1alpha.QuestionServiceClient', () => { new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getQuestion(request), expectedError); @@ -394,7 +393,6 @@ describe('v1alpha.QuestionServiceClient', () => { new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createQuestion(request), expectedError); @@ -521,7 +519,6 @@ describe('v1alpha.QuestionServiceClient', () => { new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.executeQuestion(request), expectedError); @@ -648,7 +645,6 @@ describe('v1alpha.QuestionServiceClient', () => { new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getUserFeedback(request), expectedError); @@ -780,7 +776,6 @@ describe('v1alpha.QuestionServiceClient', () => { ); request.userFeedback = {}; request.userFeedback.name = ''; - const expectedHeaderRequestParams = 'user_feedback.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateUserFeedback(request), expectedError); From 7d6036805028c1a4ba8066770df342adc2edc692 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 02:36:11 +0000 Subject: [PATCH 54/77] build(node): update client library version in samples metadata (#1356) (#107) * 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 --- ...metadata.google.cloud.dataqna.v1alpha.json | 540 +++++++++--------- 1 file changed, 270 insertions(+), 270 deletions(-) diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json index 0691eddcd06..ae6307a9551 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json @@ -1,283 +1,283 @@ { - "clientLibrary": { - "name": "nodejs-dataqna", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.dataqna.v1alpha", - "version": "v1alpha" - } - ] - }, - "snippets": [ - { - "regionTag": "dataqna_v1alpha_generated_AutoSuggestionService_SuggestQueries_async", - "title": "AutoSuggestionService suggestQueries Sample", - "origin": "API_DEFINITION", - "description": " Gets a list of suggestions based on a prefix string. AutoSuggestion tolerance should be less than 1 second.", - "canonical": true, - "file": "auto_suggestion_service.suggest_queries.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SuggestQueries", - "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionService.SuggestQueries", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "scopes", - "type": "TYPE_STRING[]" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "suggestion_types", - "type": "TYPE_ENUM[]" - } - ], - "resultType": ".google.cloud.dataqna.v1alpha.SuggestQueriesResponse", - "client": { - "shortName": "AutoSuggestionServiceClient", - "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionServiceClient" - }, - "method": { - "shortName": "SuggestQueries", - "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionService.SuggestQueries", - "service": { - "shortName": "AutoSuggestionService", - "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionService" - } - } - } + "clientLibrary": { + "name": "nodejs-dataqna", + "version": "1.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.dataqna.v1alpha", + "version": "v1alpha" + } + ] }, - { - "regionTag": "dataqna_v1alpha_generated_QuestionService_GetQuestion_async", - "title": "AutoSuggestionService getQuestion Sample", - "origin": "API_DEFINITION", - "description": " Gets a previously created question.", - "canonical": true, - "file": "question_service.get_question.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetQuestion", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetQuestion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "read_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.dataqna.v1alpha.Question", - "client": { - "shortName": "QuestionServiceClient", - "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + "regionTag": "dataqna_v1alpha_generated_AutoSuggestionService_SuggestQueries_async", + "title": "AutoSuggestionService suggestQueries Sample", + "origin": "API_DEFINITION", + "description": " Gets a list of suggestions based on a prefix string. AutoSuggestion tolerance should be less than 1 second.", + "canonical": true, + "file": "auto_suggestion_service.suggest_queries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SuggestQueries", + "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionService.SuggestQueries", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "scopes", + "type": "TYPE_STRING[]" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "suggestion_types", + "type": "TYPE_ENUM[]" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.SuggestQueriesResponse", + "client": { + "shortName": "AutoSuggestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionServiceClient" + }, + "method": { + "shortName": "SuggestQueries", + "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionService.SuggestQueries", + "service": { + "shortName": "AutoSuggestionService", + "fullName": "google.cloud.dataqna.v1alpha.AutoSuggestionService" + } + } + } }, - "method": { - "shortName": "GetQuestion", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetQuestion", - "service": { - "shortName": "QuestionService", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService" - } - } - } - }, - { - "regionTag": "dataqna_v1alpha_generated_QuestionService_CreateQuestion_async", - "title": "AutoSuggestionService createQuestion Sample", - "origin": "API_DEFINITION", - "description": " Creates a question.", - "canonical": true, - "file": "question_service.create_question.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateQuestion", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService.CreateQuestion", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "question", - "type": ".google.cloud.dataqna.v1alpha.Question" - } - ], - "resultType": ".google.cloud.dataqna.v1alpha.Question", - "client": { - "shortName": "QuestionServiceClient", - "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + "regionTag": "dataqna_v1alpha_generated_QuestionService_GetQuestion_async", + "title": "AutoSuggestionService getQuestion Sample", + "origin": "API_DEFINITION", + "description": " Gets a previously created question.", + "canonical": true, + "file": "question_service.get_question.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetQuestion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "read_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.Question", + "client": { + "shortName": "QuestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + }, + "method": { + "shortName": "GetQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetQuestion", + "service": { + "shortName": "QuestionService", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService" + } + } + } }, - "method": { - "shortName": "CreateQuestion", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService.CreateQuestion", - "service": { - "shortName": "QuestionService", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService" - } - } - } - }, - { - "regionTag": "dataqna_v1alpha_generated_QuestionService_ExecuteQuestion_async", - "title": "AutoSuggestionService executeQuestion Sample", - "origin": "API_DEFINITION", - "description": " Executes an interpretation.", - "canonical": true, - "file": "question_service.execute_question.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExecuteQuestion", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService.ExecuteQuestion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "interpretation_index", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.dataqna.v1alpha.Question", - "client": { - "shortName": "QuestionServiceClient", - "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + "regionTag": "dataqna_v1alpha_generated_QuestionService_CreateQuestion_async", + "title": "AutoSuggestionService createQuestion Sample", + "origin": "API_DEFINITION", + "description": " Creates a question.", + "canonical": true, + "file": "question_service.create_question.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.CreateQuestion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "question", + "type": ".google.cloud.dataqna.v1alpha.Question" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.Question", + "client": { + "shortName": "QuestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + }, + "method": { + "shortName": "CreateQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.CreateQuestion", + "service": { + "shortName": "QuestionService", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService" + } + } + } }, - "method": { - "shortName": "ExecuteQuestion", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService.ExecuteQuestion", - "service": { - "shortName": "QuestionService", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService" - } - } - } - }, - { - "regionTag": "dataqna_v1alpha_generated_QuestionService_GetUserFeedback_async", - "title": "AutoSuggestionService getUserFeedback Sample", - "origin": "API_DEFINITION", - "description": " Gets previously created user feedback.", - "canonical": true, - "file": "question_service.get_user_feedback.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetUserFeedback", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetUserFeedback", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataqna.v1alpha.UserFeedback", - "client": { - "shortName": "QuestionServiceClient", - "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + "regionTag": "dataqna_v1alpha_generated_QuestionService_ExecuteQuestion_async", + "title": "AutoSuggestionService executeQuestion Sample", + "origin": "API_DEFINITION", + "description": " Executes an interpretation.", + "canonical": true, + "file": "question_service.execute_question.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExecuteQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.ExecuteQuestion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "interpretation_index", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.Question", + "client": { + "shortName": "QuestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + }, + "method": { + "shortName": "ExecuteQuestion", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.ExecuteQuestion", + "service": { + "shortName": "QuestionService", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService" + } + } + } }, - "method": { - "shortName": "GetUserFeedback", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetUserFeedback", - "service": { - "shortName": "QuestionService", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService" - } - } - } - }, - { - "regionTag": "dataqna_v1alpha_generated_QuestionService_UpdateUserFeedback_async", - "title": "AutoSuggestionService updateUserFeedback Sample", - "origin": "API_DEFINITION", - "description": " Updates user feedback. This creates user feedback if there was none before (upsert).", - "canonical": true, - "file": "question_service.update_user_feedback.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateUserFeedback", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService.UpdateUserFeedback", - "async": true, - "parameters": [ - { - "name": "user_feedback", - "type": ".google.cloud.dataqna.v1alpha.UserFeedback" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.dataqna.v1alpha.UserFeedback", - "client": { - "shortName": "QuestionServiceClient", - "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + "regionTag": "dataqna_v1alpha_generated_QuestionService_GetUserFeedback_async", + "title": "AutoSuggestionService getUserFeedback Sample", + "origin": "API_DEFINITION", + "description": " Gets previously created user feedback.", + "canonical": true, + "file": "question_service.get_user_feedback.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUserFeedback", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetUserFeedback", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.UserFeedback", + "client": { + "shortName": "QuestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + }, + "method": { + "shortName": "GetUserFeedback", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.GetUserFeedback", + "service": { + "shortName": "QuestionService", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService" + } + } + } }, - "method": { - "shortName": "UpdateUserFeedback", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService.UpdateUserFeedback", - "service": { - "shortName": "QuestionService", - "fullName": "google.cloud.dataqna.v1alpha.QuestionService" - } + { + "regionTag": "dataqna_v1alpha_generated_QuestionService_UpdateUserFeedback_async", + "title": "AutoSuggestionService updateUserFeedback Sample", + "origin": "API_DEFINITION", + "description": " Updates user feedback. This creates user feedback if there was none before (upsert).", + "canonical": true, + "file": "question_service.update_user_feedback.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUserFeedback", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.UpdateUserFeedback", + "async": true, + "parameters": [ + { + "name": "user_feedback", + "type": ".google.cloud.dataqna.v1alpha.UserFeedback" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.dataqna.v1alpha.UserFeedback", + "client": { + "shortName": "QuestionServiceClient", + "fullName": "google.cloud.dataqna.v1alpha.QuestionServiceClient" + }, + "method": { + "shortName": "UpdateUserFeedback", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService.UpdateUserFeedback", + "service": { + "shortName": "QuestionService", + "fullName": "google.cloud.dataqna.v1alpha.QuestionService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From edcf35677722d0393a47f06bc3a21b5c8fe55d14 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 3 May 2022 03:24:11 +0200 Subject: [PATCH 55/77] chore(deps): update dependency @types/mocha to v9 (#108) 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.4` -> `^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-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 124d582902f..c5a976114a8 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -43,7 +43,7 @@ "google-gax": "^2.24.1" }, "devDependencies": { - "@types/mocha": "^8.0.4", + "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.3.5", From 80fd20662f6bd71e3aa03b932e7b9a512ff9a1a7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:38:19 +0200 Subject: [PATCH 56/77] chore(deps): update dependency sinon to v14 (#111) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^13.0.0` -> `^14.0.0`](https://renovatebot.com/diffs/npm/sinon/13.0.2/14.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/compatibility-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/confidence-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v14.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1400) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v13.0.2...v14.0.0) - [`c2bbd826`](https://togithub.com/sinonjs/sinon/commit/c2bbd82641444eb5b32822489ae40f185afbbf00) Drop node 12 (Morgan Roderick) > And embrace Node 18 > > See https://nodejs.org/en/about/releases/ *Released by Morgan Roderick on 2022-05-07.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index c5a976114a8..1508b2cf522 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -55,7 +55,7 @@ "mocha": "^8.2.1", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", + "sinon": "^14.0.0", "ts-loader": "^9.0.0", "typescript": "^4.1.2", "webpack": "^5.9.0", From d7c840f8fb83b91bf59c878fba2e9aaa92cf3c7b Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Fri, 20 May 2022 11:32:05 -0700 Subject: [PATCH 57/77] build!: update library to use Node 12 (#112) * build!: Update library to use Node 12 --- packages/google-cloud-dataqna/package.json | 10 +++++----- packages/google-cloud-dataqna/samples/package.json | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 1508b2cf522..6b0e1468d31 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -40,28 +40,28 @@ "test": "c8 mocha build/test" }, "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.3.5", - "gts": "^3.0.3", + "gts": "^3.1.0", "jsdoc": "^3.6.6", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.6", "linkinator": "^2.7.0", - "mocha": "^8.2.1", + "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", "sinon": "^14.0.0", "ts-loader": "^9.0.0", - "typescript": "^4.1.2", + "typescript": "^4.6.4", "webpack": "^5.9.0", "webpack-cli": "^4.2.0" }, "engines": { - "node": ">=10.0.0" + "node": ">=12.0.0" } } diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index 458394109d1..0fdeae7eac1 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" @@ -20,4 +20,4 @@ "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file From 8b3cf5621ecc165bf0a2d0c036ff2c3517adbc2f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:02:13 +0200 Subject: [PATCH 58/77] chore(deps): update dependency jsdoc-region-tag to v2 (#117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc-region-tag](https://togithub.com/googleapis/jsdoc-region-tag) | [`^1.0.6` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-region-tag/1.3.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/compatibility-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/confidence-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-region-tag ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-region-tag/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-region-tagcomparev131v200-2022-05-20) [Compare Source](https://togithub.com/googleapis/jsdoc-region-tag/compare/v1.3.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ##### Build System - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ([5b51796](https://togithub.com/googleapis/jsdoc-region-tag/commit/5b51796771984cf8b978990025f14faa03c19923)) ##### [1.3.1](https://www.github.com/googleapis/jsdoc-region-tag/compare/v1.3.0...v1.3.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​79](https://www.togithub.com/googleapis/jsdoc-region-tag/issues/79)) ([5050615](https://www.github.com/googleapis/jsdoc-region-tag/commit/50506150b7758592df5e389c6a5c3d82b3b20881))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 6b0e1468d31..daa377ec89a 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -50,7 +50,7 @@ "gts": "^3.1.0", "jsdoc": "^3.6.6", "jsdoc-fresh": "^1.0.2", - "jsdoc-region-tag": "^1.0.6", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.7.0", "mocha": "^9.2.2", "null-loader": "^4.0.1", From ac7a171c09ca56b6d8957930e11971ef62b5b722 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:24:40 +0200 Subject: [PATCH 59/77] chore(deps): update dependency jsdoc-fresh to v2 (#116) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc-fresh](https://togithub.com/googleapis/jsdoc-fresh) | [`^1.0.2` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-fresh/1.1.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/compatibility-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/confidence-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-fresh ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-fresh/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-freshcomparev111v200-2022-05-18) [Compare Source](https://togithub.com/googleapis/jsdoc-fresh/compare/v1.1.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ##### Build System - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ([e61c223](https://togithub.com/googleapis/jsdoc-fresh/commit/e61c2238db8900e339e5fe7fb8aea09642290182)) ##### [1.1.1](https://www.github.com/googleapis/jsdoc-fresh/compare/v1.1.0...v1.1.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​83](https://www.togithub.com/googleapis/jsdoc-fresh/issues/83)) ([9474adb](https://www.github.com/googleapis/jsdoc-fresh/commit/9474adbf0d559d319ff207397ba2be6b557999ac))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index daa377ec89a..c959d79b36e 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -49,7 +49,7 @@ "c8": "^7.3.5", "gts": "^3.1.0", "jsdoc": "^3.6.6", - "jsdoc-fresh": "^1.0.2", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.7.0", "mocha": "^9.2.2", From 256991fd36b2210dd5e1da81314765ae4084a213 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 16:12:41 -0400 Subject: [PATCH 60/77] chore(main): release 2.0.0 (#114) 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 Co-authored-by: Benjamin E. Coe --- packages/google-cloud-dataqna/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-dataqna/package.json | 2 +- ...snippet_metadata.google.cloud.dataqna.v1alpha.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index 8fba173925c..6616464e166 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.0.0](https://github.com/googleapis/nodejs-data-qna/compare/v1.1.0...v2.0.0) (2022-06-10) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#112) + +### Build System + +* update library to use Node 12 ([#112](https://github.com/googleapis/nodejs-data-qna/issues/112)) ([7ff17f3](https://github.com/googleapis/nodejs-data-qna/commit/7ff17f3aaad5ad986b2b1432664424b14be3cfae)) + ## [1.1.0](https://www.github.com/googleapis/nodejs-data-qna/compare/v1.0.8...v1.1.0) (2021-09-13) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index c959d79b36e..4fd15afb291 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "1.1.0", + "version": "2.0.0", "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json index ae6307a9551..59852a8f9f1 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataqna", - "version": "1.1.0", + "version": "2.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index 0fdeae7eac1..3b21af9a272 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^1.1.0" + "@google-cloud/data-qna": "^2.0.0" }, "devDependencies": { "c8": "^7.1.0", From 933200454c0ea502eb86b13311ed25ae1b98f555 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 14:55:05 -0700 Subject: [PATCH 61/77] fix(docs): document fallback rest option (#118) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support regapic LRO Use gapic-generator-typescript v2.15.1. PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 * feat: support regapic LRO Use gapic-generator-typescript v2.15.1. PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../src/v1alpha/auto_suggestion_service_client.ts | 11 +++++------ .../src/v1alpha/question_service_client.ts | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index 59613b73b50..763d83d3962 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -126,7 +126,7 @@ export class AutoSuggestionServiceClient { * * @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] @@ -149,11 +149,10 @@ export class AutoSuggestionServiceClient { * 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-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index c5f9c834923..586bee4a37f 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -75,7 +75,7 @@ export class QuestionServiceClient { * * @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] @@ -98,11 +98,10 @@ export class QuestionServiceClient { * 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 8b6763d8278b97f53435f126dc7ba01f014089f7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 13 Jul 2022 02:00:31 +0200 Subject: [PATCH 62/77] chore(deps): update dependency linkinator to v4 (#121) 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.7.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.2) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
JustinBeckwith/linkinator ### [`v4.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v4.0.1...v4.0.2) ##### Bug Fixes - address srcset parsing with multiple spaces ([#​512](https://togithub.com/JustinBeckwith/linkinator/issues/512)) ([fefb5b6](https://togithub.com/JustinBeckwith/linkinator/commit/fefb5b6734fc4ab335793358c5f491338ecbeb90)) ### [`v4.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v4.0.0...v4.0.1) ##### Bug Fixes - properly parse srcset attribute ([#​510](https://togithub.com/JustinBeckwith/linkinator/issues/510)) ([9a8a83c](https://togithub.com/JustinBeckwith/linkinator/commit/9a8a83c35182b3cd4daee62a00f156767fe5c6a7)) ### [`v4.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.1.0...v4.0.0) ##### Features - create new release with notes ([#​508](https://togithub.com/JustinBeckwith/linkinator/issues/508)) ([2cab633](https://togithub.com/JustinBeckwith/linkinator/commit/2cab633c9659eb10794a4bac06f8b0acdc3e2c0c)) ##### BREAKING CHANGES - The commits in [#​507](https://togithub.com/JustinBeckwith/linkinator/issues/507) and [#​506](https://togithub.com/JustinBeckwith/linkinator/issues/506) both had breaking changes. They included dropping support for Node.js 12.x and updating the CSV export to be streaming, and to use a new way of writing the CSV file. This is an empty to commit using the `BREAKING CHANGE` format in the commit message to ensure a release is triggered. ### [`v3.1.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.1.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.6...v3.1.0) ##### Features - allow --skip to be defined multiple times ([#​399](https://togithub.com/JustinBeckwith/linkinator/issues/399)) ([5ca5a46](https://togithub.com/JustinBeckwith/linkinator/commit/5ca5a461508e688de12e5ae6b4cfb6565f832ebf)) ### [`v3.0.6`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.6) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.5...v3.0.6) ##### Bug Fixes - **deps:** upgrade node-glob to v8 ([#​397](https://togithub.com/JustinBeckwith/linkinator/issues/397)) ([d334dc6](https://togithub.com/JustinBeckwith/linkinator/commit/d334dc6734cd7c2b73d7ed3dea0550a6c3072ad5)) ### [`v3.0.5`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.5) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.4...v3.0.5) ##### Bug Fixes - **deps:** upgrade to htmlparser2 v8.0.1 ([#​396](https://togithub.com/JustinBeckwith/linkinator/issues/396)) ([ba3b9a8](https://togithub.com/JustinBeckwith/linkinator/commit/ba3b9a8a9b19d39af6ed91790135e833b80c1eb6)) ### [`v3.0.4`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.4) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.3...v3.0.4) ##### Bug Fixes - **deps:** update dependency gaxios to v5 ([#​391](https://togithub.com/JustinBeckwith/linkinator/issues/391)) ([48af50e](https://togithub.com/JustinBeckwith/linkinator/commit/48af50e787731204aeb7eff41325c62291311e45)) ### [`v3.0.3`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.3) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.2...v3.0.3) ##### Bug Fixes - export getConfig from index ([#​371](https://togithub.com/JustinBeckwith/linkinator/issues/371)) ([0bc0355](https://togithub.com/JustinBeckwith/linkinator/commit/0bc0355c7e2ea457f247e6b52d1577b8c4ecb3a1)) ### [`v3.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.1...v3.0.2) ##### Bug Fixes - allow server root with trailing slash ([#​370](https://togithub.com/JustinBeckwith/linkinator/issues/370)) ([8adf6b0](https://togithub.com/JustinBeckwith/linkinator/commit/8adf6b025fda250e38461f1cdad40fe08c3b3b7c)) ### [`v3.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.0...v3.0.1) ##### Bug Fixes - decode path parts in local web server ([#​369](https://togithub.com/JustinBeckwith/linkinator/issues/369)) ([4696a0c](https://togithub.com/JustinBeckwith/linkinator/commit/4696a0c38c341b178ed815f47371fca955979feb)) ### [`v3.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v2.16.2...v3.0.0) ##### Bug Fixes - **deps:** update dependency chalk to v5 ([#​362](https://togithub.com/JustinBeckwith/linkinator/issues/362)) ([4b17a8d](https://togithub.com/JustinBeckwith/linkinator/commit/4b17a8d87b649eaf813428f8ee6955e1d21dae4f)) - feat!: convert to es modules, drop node 10 ([#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359)) ([efee299](https://togithub.com/JustinBeckwith/linkinator/commit/efee299ab8a805accef751eecf8538915a4e7783)), closes [#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359) ##### BREAKING CHANGES - this module now requires node.js 12 and above, and has moved to es modules by default.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 4fd15afb291..d2c133cb860 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -51,7 +51,7 @@ "jsdoc": "^3.6.6", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.7.0", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", From 2ba0a7aa126cbf3596ac84e76c92364844a19fc5 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:14:10 +0000 Subject: [PATCH 63/77] fix: better support for fallback mode (#122) - [ ] 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 --- ...auto_suggestion_service.suggest_queries.js | 3 + .../question_service.create_question.js | 3 + .../question_service.execute_question.js | 3 + .../v1alpha/question_service.get_question.js | 3 + .../question_service.get_user_feedback.js | 3 + .../question_service.update_user_feedback.js | 3 + ...metadata.google.cloud.dataqna.v1alpha.json | 12 +- .../v1alpha/auto_suggestion_service_client.ts | 3 +- .../src/v1alpha/question_service_client.ts | 3 +- .../gapic_auto_suggestion_service_v1alpha.ts | 182 +++++++++--------- .../test/gapic_question_service_v1alpha.ts | 164 ++++++++-------- 11 files changed, 203 insertions(+), 179 deletions(-) diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js index 5ad8c62cadc..07f9ca26cb6 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js @@ -23,6 +23,9 @@ function main(parent) { // [START dataqna_v1alpha_generated_AutoSuggestionService_SuggestQueries_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-dataqna/samples/generated/v1alpha/question_service.create_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js index b5ecc9a0d65..49e642e70d8 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js @@ -23,6 +23,9 @@ function main(parent, question) { // [START dataqna_v1alpha_generated_QuestionService_CreateQuestion_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-dataqna/samples/generated/v1alpha/question_service.execute_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js index 7622a04c69e..f7ceab96359 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js @@ -23,6 +23,9 @@ function main(name, interpretationIndex) { // [START dataqna_v1alpha_generated_QuestionService_ExecuteQuestion_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-dataqna/samples/generated/v1alpha/question_service.get_question.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js index 7402a695a7b..56aae2fa6ea 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js @@ -23,6 +23,9 @@ function main(name) { // [START dataqna_v1alpha_generated_QuestionService_GetQuestion_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-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js index 58bb01bb9da..a8f29a28aab 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js @@ -23,6 +23,9 @@ function main(name) { // [START dataqna_v1alpha_generated_QuestionService_GetUserFeedback_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-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js index 00ed986dbb6..02f393bb578 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js @@ -23,6 +23,9 @@ function main(userFeedback) { // [START dataqna_v1alpha_generated_QuestionService_UpdateUserFeedback_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-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json index 59852a8f9f1..6b4289621f2 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -74,7 +74,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -162,7 +162,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -206,7 +206,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -246,7 +246,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index 763d83d3962..a35f663ca13 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -301,7 +301,8 @@ export class AutoSuggestionServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index 586bee4a37f..1f02a8cd01e 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -254,7 +254,8 @@ export class QuestionServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts index 92225909c0b..91ad45cbbdf 100644 --- a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts @@ -50,111 +50,113 @@ function stubSimpleCallWithCallback( } describe('v1alpha.AutoSuggestionServiceClient', () => { - it('has servicePath', () => { - const servicePath = - autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ + fallback: true, + }); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.autoSuggestionServiceStub, undefined); - await client.initialize(); - assert(client.autoSuggestionServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoSuggestionServiceStub, undefined); + await client.initialize(); + assert(client.autoSuggestionServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.autoSuggestionServiceStub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.autoSuggestionServiceStub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoSuggestionServiceStub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.autoSuggestionServiceStub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ - 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 autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ + 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 autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ - 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 autosuggestionserviceModule.v1alpha.AutoSuggestionServiceClient({ + 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('suggestQueries', () => { diff --git a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts index ea232a3419b..dae06205f41 100644 --- a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts @@ -50,101 +50,103 @@ function stubSimpleCallWithCallback( } describe('v1alpha.QuestionServiceClient', () => { - it('has servicePath', () => { - const servicePath = - questionserviceModule.v1alpha.QuestionServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - questionserviceModule.v1alpha.QuestionServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = questionserviceModule.v1alpha.QuestionServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + questionserviceModule.v1alpha.QuestionServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new questionserviceModule.v1alpha.QuestionServiceClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + questionserviceModule.v1alpha.QuestionServiceClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new questionserviceModule.v1alpha.QuestionServiceClient({ - fallback: true, + it('has port', () => { + const port = questionserviceModule.v1alpha.QuestionServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new questionserviceModule.v1alpha.QuestionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient(); + assert(client); }); - assert.strictEqual(client.questionServiceStub, undefined); - await client.initialize(); - assert(client.questionServiceStub); - }); - it('has close method for the initialized client', done => { - const client = new questionserviceModule.v1alpha.QuestionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.questionServiceStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.questionServiceStub, undefined); + await client.initialize(); + assert(client.questionServiceStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new questionserviceModule.v1alpha.QuestionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.questionServiceStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.questionServiceStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.questionServiceStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new questionserviceModule.v1alpha.QuestionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new questionserviceModule.v1alpha.QuestionServiceClient({ - 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 getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new questionserviceModule.v1alpha.QuestionServiceClient({ + 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('getQuestion', () => { From a2deefe3011fcf5d6379b50c13cef45e28702b21 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 17:00:34 +0000 Subject: [PATCH 64/77] fix: change import long to require (#123) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../google-cloud-dataqna/protos/protos.d.ts | 483 ++- .../google-cloud-dataqna/protos/protos.js | 3112 ++++++++++++----- .../google-cloud-dataqna/protos/protos.json | 24 + 3 files changed, 2703 insertions(+), 916 deletions(-) diff --git a/packages/google-cloud-dataqna/protos/protos.d.ts b/packages/google-cloud-dataqna/protos/protos.d.ts index b6d92e180e9..58b1bcd50cd 100644 --- a/packages/google-cloud-dataqna/protos/protos.d.ts +++ b/packages/google-cloud-dataqna/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 { @@ -126,6 +126,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotatedString + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AnnotatedString { @@ -230,6 +237,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SemanticMarkup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** SemanticMarkupType enum. */ @@ -282,7 +296,7 @@ export namespace google { namespace AutoSuggestionService { /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.AutoSuggestionService#suggestQueries}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.AutoSuggestionService|suggestQueries}. * @param error Error, if any * @param [response] SuggestQueriesResponse */ @@ -395,6 +409,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SuggestQueriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Suggestion. */ @@ -497,6 +518,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Suggestion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SuggestionInfo. */ @@ -593,6 +621,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SuggestionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace SuggestionInfo { @@ -691,6 +726,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MatchInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -782,6 +824,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SuggestQueriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** SuggestionType enum. */ @@ -933,6 +982,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Question + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an InterpretError. */ @@ -1035,6 +1091,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterpretError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace InterpretError { @@ -1139,6 +1202,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterpretErrorDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an InterpretUnsupportedDetails. */ @@ -1235,6 +1305,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterpretUnsupportedDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an InterpretIncompleteQueryDetails. */ @@ -1325,6 +1402,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterpretIncompleteQueryDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an InterpretAmbiguityDetails. */ @@ -1409,6 +1493,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterpretAmbiguityDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** InterpretErrorCode enum. */ @@ -1526,6 +1617,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ExecutionInfo { @@ -1640,6 +1738,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Interpretation. */ @@ -1766,6 +1871,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Interpretation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DataQuery. */ @@ -1856,6 +1968,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a HumanReadable. */ @@ -1952,6 +2071,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HumanReadable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an InterpretationStructure. */ @@ -2048,6 +2174,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterpretationStructure + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace InterpretationStructure { @@ -2146,6 +2279,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** VisualizationType enum. */ @@ -2320,6 +2460,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DebugFlags + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** InterpretEntity enum. */ @@ -2423,35 +2570,35 @@ export namespace google { namespace QuestionService { /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#getQuestion}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService|getQuestion}. * @param error Error, if any * @param [response] Question */ type GetQuestionCallback = (error: (Error|null), response?: google.cloud.dataqna.v1alpha.Question) => void; /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#createQuestion}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService|createQuestion}. * @param error Error, if any * @param [response] Question */ type CreateQuestionCallback = (error: (Error|null), response?: google.cloud.dataqna.v1alpha.Question) => void; /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#executeQuestion}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService|executeQuestion}. * @param error Error, if any * @param [response] Question */ type ExecuteQuestionCallback = (error: (Error|null), response?: google.cloud.dataqna.v1alpha.Question) => void; /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#getUserFeedback}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService|getUserFeedback}. * @param error Error, if any * @param [response] UserFeedback */ type GetUserFeedbackCallback = (error: (Error|null), response?: google.cloud.dataqna.v1alpha.UserFeedback) => void; /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#updateUserFeedback}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService|updateUserFeedback}. * @param error Error, if any * @param [response] UserFeedback */ @@ -2552,6 +2699,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetQuestionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateQuestionRequest. */ @@ -2648,6 +2802,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateQuestionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an ExecuteQuestionRequest. */ @@ -2744,6 +2905,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteQuestionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetUserFeedbackRequest. */ @@ -2834,6 +3002,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetUserFeedbackRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateUserFeedbackRequest. */ @@ -2930,6 +3105,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateUserFeedbackRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a UserFeedback. */ @@ -3032,6 +3214,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserFeedback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace UserFeedback { @@ -3144,6 +3333,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. */ @@ -3291,6 +3487,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. */ @@ -3387,6 +3590,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. */ @@ -3525,6 +3735,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 { @@ -3637,6 +3854,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; } } @@ -3731,6 +3955,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. */ @@ -3771,6 +4002,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -3818,6 +4052,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 @@ -3887,6 +4124,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. */ @@ -4031,6 +4275,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 { @@ -4135,6 +4386,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. */ @@ -4231,6 +4489,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; } } @@ -4322,6 +4587,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. */ @@ -4472,6 +4744,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 { @@ -4600,6 +4879,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. */ @@ -4714,6 +5000,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 { @@ -4812,6 +5105,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; } } @@ -4915,6 +5215,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. */ @@ -5017,6 +5324,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. */ @@ -5137,6 +5451,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. */ @@ -5350,6 +5671,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 { @@ -5477,6 +5805,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. */ @@ -5494,6 +5829,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -5531,6 +5869,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -5609,6 +5950,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 { @@ -5716,6 +6064,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. */ @@ -5818,6 +6173,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. */ @@ -5914,6 +6276,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. */ @@ -6016,6 +6385,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. */ @@ -6124,6 +6500,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 { @@ -6260,6 +6643,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 { @@ -6358,6 +6748,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; } } @@ -6449,6 +6846,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 { @@ -6565,6 +6969,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; } } @@ -6656,6 +7067,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 { @@ -6674,6 +7092,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. */ @@ -6697,6 +7118,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 @@ -6766,6 +7190,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 + } } } @@ -6863,6 +7304,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Timestamp. */ @@ -6959,6 +7407,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FieldMask. */ @@ -7049,6 +7504,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; } } @@ -7155,6 +7617,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } diff --git a/packages/google-cloud-dataqna/protos/protos.js b/packages/google-cloud-dataqna/protos/protos.js index 6eae39bbd31..25890ae18e7 100644 --- a/packages/google-cloud-dataqna/protos/protos.js +++ b/packages/google-cloud-dataqna/protos/protos.js @@ -182,17 +182,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.textFormatted = reader.string(); - break; - case 2: - message.htmlFormatted = reader.string(); - break; - case 3: - if (!(message.markups && message.markups.length)) - message.markups = []; - message.markups.push($root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup.decode(reader, reader.uint32())); - break; + case 1: { + message.textFormatted = reader.string(); + break; + } + case 2: { + message.htmlFormatted = reader.string(); + break; + } + case 3: { + if (!(message.markups && message.markups.length)) + message.markups = []; + message.markups.push($root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -317,6 +320,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnnotatedString + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotatedString.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.AnnotatedString"; + }; + AnnotatedString.SemanticMarkup = (function() { /** @@ -431,15 +449,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.type = reader.int32(); - break; - case 2: - message.startCharIndex = reader.int32(); - break; - case 3: - message.length = reader.int32(); - break; + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.startCharIndex = reader.int32(); + break; + } + case 3: { + message.length = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -584,6 +605,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SemanticMarkup + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticMarkup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup"; + }; + return SemanticMarkup; })(); @@ -647,7 +683,7 @@ }; /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.AutoSuggestionService#suggestQueries}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.AutoSuggestionService|suggestQueries}. * @memberof google.cloud.dataqna.v1alpha.AutoSuggestionService * @typedef SuggestQueriesCallback * @type {function} @@ -814,27 +850,31 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.scopes && message.scopes.length)) - message.scopes = []; - message.scopes.push(reader.string()); - break; - case 3: - message.query = reader.string(); - break; - case 4: - if (!(message.suggestionTypes && message.suggestionTypes.length)) - message.suggestionTypes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + case 3: { + message.query = reader.string(); + break; + } + case 4: { + if (!(message.suggestionTypes && message.suggestionTypes.length)) + message.suggestionTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.suggestionTypes.push(reader.int32()); + } else message.suggestionTypes.push(reader.int32()); - } else - message.suggestionTypes.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -995,6 +1035,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SuggestQueriesRequest + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SuggestQueriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.SuggestQueriesRequest"; + }; + return SuggestQueriesRequest; })(); @@ -1112,15 +1167,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.suggestionInfo = $root.google.cloud.dataqna.v1alpha.SuggestionInfo.decode(reader, reader.uint32()); - break; - case 2: - message.rankingScore = reader.double(); - break; - case 3: - message.suggestionType = reader.int32(); - break; + case 1: { + message.suggestionInfo = $root.google.cloud.dataqna.v1alpha.SuggestionInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + message.rankingScore = reader.double(); + break; + } + case 3: { + message.suggestionType = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -1250,6 +1308,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Suggestion + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.Suggestion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Suggestion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.Suggestion"; + }; + return Suggestion; })(); @@ -1358,14 +1431,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.annotatedSuggestion = $root.google.cloud.dataqna.v1alpha.AnnotatedString.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.queryMatches && message.queryMatches.length)) - message.queryMatches = []; - message.queryMatches.push($root.google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo.decode(reader, reader.uint32())); - break; + case 1: { + message.annotatedSuggestion = $root.google.cloud.dataqna.v1alpha.AnnotatedString.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.queryMatches && message.queryMatches.length)) + message.queryMatches = []; + message.queryMatches.push($root.google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -1486,6 +1561,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SuggestionInfo + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SuggestionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.SuggestionInfo"; + }; + SuggestionInfo.MatchInfo = (function() { /** @@ -1589,12 +1679,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.startCharIndex = reader.int32(); - break; - case 2: - message.length = reader.int32(); - break; + case 1: { + message.startCharIndex = reader.int32(); + break; + } + case 2: { + message.length = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -1693,6 +1785,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MatchInfo + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MatchInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.SuggestionInfo.MatchInfo"; + }; + return MatchInfo; })(); @@ -1793,11 +1900,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.suggestions && message.suggestions.length)) - message.suggestions = []; - message.suggestions.push($root.google.cloud.dataqna.v1alpha.Suggestion.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.suggestions && message.suggestions.length)) + message.suggestions = []; + message.suggestions.push($root.google.cloud.dataqna.v1alpha.Suggestion.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -1904,6 +2012,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SuggestQueriesResponse + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.SuggestQueriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SuggestQueriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.SuggestQueriesResponse"; + }; + return SuggestQueriesResponse; })(); @@ -2120,42 +2243,52 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.scopes && message.scopes.length)) - message.scopes = []; - message.scopes.push(reader.string()); - break; - case 3: - message.query = reader.string(); - break; - case 4: - if (!(message.dataSourceAnnotations && message.dataSourceAnnotations.length)) - message.dataSourceAnnotations = []; - message.dataSourceAnnotations.push(reader.string()); - break; - case 5: - message.interpretError = $root.google.cloud.dataqna.v1alpha.InterpretError.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.interpretations && message.interpretations.length)) - message.interpretations = []; - message.interpretations.push($root.google.cloud.dataqna.v1alpha.Interpretation.decode(reader, reader.uint32())); - break; - case 7: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 8: - message.userEmail = reader.string(); - break; - case 9: - message.debugFlags = $root.google.cloud.dataqna.v1alpha.DebugFlags.decode(reader, reader.uint32()); - break; - case 10: - message.debugInfo = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + case 3: { + message.query = reader.string(); + break; + } + case 4: { + if (!(message.dataSourceAnnotations && message.dataSourceAnnotations.length)) + message.dataSourceAnnotations = []; + message.dataSourceAnnotations.push(reader.string()); + break; + } + case 5: { + message.interpretError = $root.google.cloud.dataqna.v1alpha.InterpretError.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.interpretations && message.interpretations.length)) + message.interpretations = []; + message.interpretations.push($root.google.cloud.dataqna.v1alpha.Interpretation.decode(reader, reader.uint32())); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.userEmail = reader.string(); + break; + } + case 9: { + message.debugFlags = $root.google.cloud.dataqna.v1alpha.DebugFlags.decode(reader, reader.uint32()); + break; + } + case 10: { + message.debugInfo = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2381,6 +2514,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Question + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.Question + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Question.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.Question"; + }; + return Question; })(); @@ -2498,15 +2646,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.message = reader.string(); - break; - case 2: - message.code = reader.int32(); - break; - case 3: - message.details = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.decode(reader, reader.uint32()); - break; + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.code = reader.int32(); + break; + } + case 3: { + message.details = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2641,6 +2792,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InterpretError + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.InterpretError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterpretError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.InterpretError"; + }; + InterpretError.InterpretErrorDetails = (function() { /** @@ -2755,15 +2921,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.unsupportedDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.decode(reader, reader.uint32()); - break; - case 2: - message.incompleteQueryDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.decode(reader, reader.uint32()); - break; - case 3: - message.ambiguityDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails.decode(reader, reader.uint32()); - break; + case 1: { + message.unsupportedDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails.decode(reader, reader.uint32()); + break; + } + case 2: { + message.incompleteQueryDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ambiguityDetails = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2885,6 +3054,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InterpretErrorDetails + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterpretErrorDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails"; + }; + return InterpretErrorDetails; })(); @@ -2995,16 +3179,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.operators && message.operators.length)) - message.operators = []; - message.operators.push(reader.string()); - break; - case 2: - if (!(message.intent && message.intent.length)) - message.intent = []; - message.intent.push(reader.string()); - break; + case 1: { + if (!(message.operators && message.operators.length)) + message.operators = []; + message.operators.push(reader.string()); + break; + } + case 2: { + if (!(message.intent && message.intent.length)) + message.intent = []; + message.intent.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -3127,6 +3313,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InterpretUnsupportedDetails + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterpretUnsupportedDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.InterpretError.InterpretUnsupportedDetails"; + }; + return InterpretUnsupportedDetails; })(); @@ -3227,16 +3428,17 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.entities && message.entities.length)) - message.entities = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + if (!(message.entities && message.entities.length)) + message.entities = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.entities.push(reader.int32()); + } else message.entities.push(reader.int32()); - } else - message.entities.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -3358,6 +3560,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InterpretIncompleteQueryDetails + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterpretIncompleteQueryDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.InterpretError.InterpretIncompleteQueryDetails"; + }; + return InterpretIncompleteQueryDetails; })(); @@ -3518,6 +3735,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InterpretAmbiguityDetails + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterpretAmbiguityDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.InterpretError.InterpretAmbiguityDetails"; + }; + return InterpretAmbiguityDetails; })(); @@ -3667,19 +3899,23 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.jobCreationStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 2: - message.jobExecutionState = reader.int32(); - break; - case 3: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.bigqueryJob = $root.google.cloud.dataqna.v1alpha.BigQueryJob.decode(reader, reader.uint32()); - break; - default: + case 1: { + message.jobCreationStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.jobExecutionState = reader.int32(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.bigqueryJob = $root.google.cloud.dataqna.v1alpha.BigQueryJob.decode(reader, reader.uint32()); + break; + } + default: reader.skipType(tag & 7); break; } @@ -3836,6 +4072,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExecutionInfo + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.ExecutionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.ExecutionInfo"; + }; + /** * JobExecutionState enum. * @name google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState @@ -3973,15 +4224,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.jobId = reader.string(); - break; - case 2: - message.projectId = reader.string(); - break; - case 3: - message.location = reader.string(); - break; + case 1: { + message.jobId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.location = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4088,6 +4342,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BigQueryJob + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.BigQueryJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.BigQueryJob"; + }; + return BigQueryJob; })(); @@ -4253,31 +4522,38 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.dataSources && message.dataSources.length)) - message.dataSources = []; - message.dataSources.push(reader.string()); - break; - case 2: - message.confidence = reader.double(); - break; - case 3: - if (!(message.unusedPhrases && message.unusedPhrases.length)) - message.unusedPhrases = []; - message.unusedPhrases.push(reader.string()); - break; - case 4: - message.humanReadable = $root.google.cloud.dataqna.v1alpha.HumanReadable.decode(reader, reader.uint32()); - break; - case 5: - message.interpretationStructure = $root.google.cloud.dataqna.v1alpha.InterpretationStructure.decode(reader, reader.uint32()); - break; - case 6: - message.dataQuery = $root.google.cloud.dataqna.v1alpha.DataQuery.decode(reader, reader.uint32()); - break; - case 7: - message.executionInfo = $root.google.cloud.dataqna.v1alpha.ExecutionInfo.decode(reader, reader.uint32()); - break; + case 1: { + if (!(message.dataSources && message.dataSources.length)) + message.dataSources = []; + message.dataSources.push(reader.string()); + break; + } + case 2: { + message.confidence = reader.double(); + break; + } + case 3: { + if (!(message.unusedPhrases && message.unusedPhrases.length)) + message.unusedPhrases = []; + message.unusedPhrases.push(reader.string()); + break; + } + case 4: { + message.humanReadable = $root.google.cloud.dataqna.v1alpha.HumanReadable.decode(reader, reader.uint32()); + break; + } + case 5: { + message.interpretationStructure = $root.google.cloud.dataqna.v1alpha.InterpretationStructure.decode(reader, reader.uint32()); + break; + } + case 6: { + message.dataQuery = $root.google.cloud.dataqna.v1alpha.DataQuery.decode(reader, reader.uint32()); + break; + } + case 7: { + message.executionInfo = $root.google.cloud.dataqna.v1alpha.ExecutionInfo.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4462,6 +4738,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Interpretation + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.Interpretation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Interpretation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.Interpretation"; + }; + return Interpretation; })(); @@ -4557,9 +4848,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.sql = reader.string(); - break; + case 1: { + message.sql = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4649,6 +4941,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DataQuery + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.DataQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.DataQuery"; + }; + return DataQuery; })(); @@ -4755,12 +5062,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.generatedInterpretation = $root.google.cloud.dataqna.v1alpha.AnnotatedString.decode(reader, reader.uint32()); - break; - case 2: - message.originalQuestion = $root.google.cloud.dataqna.v1alpha.AnnotatedString.decode(reader, reader.uint32()); - break; + case 1: { + message.generatedInterpretation = $root.google.cloud.dataqna.v1alpha.AnnotatedString.decode(reader, reader.uint32()); + break; + } + case 2: { + message.originalQuestion = $root.google.cloud.dataqna.v1alpha.AnnotatedString.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4869,6 +5178,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for HumanReadable + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.HumanReadable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HumanReadable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.HumanReadable"; + }; + return HumanReadable; })(); @@ -4982,21 +5306,23 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.visualizationTypes && message.visualizationTypes.length)) - message.visualizationTypes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + if (!(message.visualizationTypes && message.visualizationTypes.length)) + message.visualizationTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.visualizationTypes.push(reader.int32()); + } else message.visualizationTypes.push(reader.int32()); - } else - message.visualizationTypes.push(reader.int32()); - break; - case 2: - if (!(message.columnInfo && message.columnInfo.length)) - message.columnInfo = []; - message.columnInfo.push($root.google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo.decode(reader, reader.uint32())); - break; + break; + } + case 2: { + if (!(message.columnInfo && message.columnInfo.length)) + message.columnInfo = []; + message.columnInfo.push($root.google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -5194,6 +5520,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InterpretationStructure + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterpretationStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.InterpretationStructure"; + }; + InterpretationStructure.ColumnInfo = (function() { /** @@ -5297,12 +5638,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.outputAlias = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; + case 1: { + message.outputAlias = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5401,6 +5744,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ColumnInfo + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.InterpretationStructure.ColumnInfo"; + }; + return ColumnInfo; })(); @@ -5656,42 +6014,54 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.includeVaQuery = reader.bool(); - break; - case 2: - message.includeNestedVaQuery = reader.bool(); - break; - case 3: - message.includeHumanInterpretation = reader.bool(); - break; - case 4: - message.includeAquaDebugResponse = reader.bool(); - break; - case 5: - message.timeOverride = reader.int64(); - break; - case 6: - message.isInternalGoogleUser = reader.bool(); - break; - case 7: - message.ignoreCache = reader.bool(); - break; - case 8: - message.includeSearchEntitiesRpc = reader.bool(); - break; - case 9: - message.includeListColumnAnnotationsRpc = reader.bool(); - break; - case 10: - message.includeVirtualAnalystEntities = reader.bool(); - break; - case 11: - message.includeTableList = reader.bool(); - break; - case 12: - message.includeDomainList = reader.bool(); - break; + case 1: { + message.includeVaQuery = reader.bool(); + break; + } + case 2: { + message.includeNestedVaQuery = reader.bool(); + break; + } + case 3: { + message.includeHumanInterpretation = reader.bool(); + break; + } + case 4: { + message.includeAquaDebugResponse = reader.bool(); + break; + } + case 5: { + message.timeOverride = reader.int64(); + break; + } + case 6: { + message.isInternalGoogleUser = reader.bool(); + break; + } + case 7: { + message.ignoreCache = reader.bool(); + break; + } + case 8: { + message.includeSearchEntitiesRpc = reader.bool(); + break; + } + case 9: { + message.includeListColumnAnnotationsRpc = reader.bool(); + break; + } + case 10: { + message.includeVirtualAnalystEntities = reader.bool(); + break; + } + case 11: { + message.includeTableList = reader.bool(); + break; + } + case 12: { + message.includeDomainList = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -5884,6 +6254,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DebugFlags + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.DebugFlags + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DebugFlags.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.DebugFlags"; + }; + return DebugFlags; })(); @@ -5936,7 +6321,7 @@ }; /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#getQuestion}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService|getQuestion}. * @memberof google.cloud.dataqna.v1alpha.QuestionService * @typedef GetQuestionCallback * @type {function} @@ -5969,7 +6354,7 @@ */ /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#createQuestion}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService|createQuestion}. * @memberof google.cloud.dataqna.v1alpha.QuestionService * @typedef CreateQuestionCallback * @type {function} @@ -6002,7 +6387,7 @@ */ /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#executeQuestion}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService|executeQuestion}. * @memberof google.cloud.dataqna.v1alpha.QuestionService * @typedef ExecuteQuestionCallback * @type {function} @@ -6035,7 +6420,7 @@ */ /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#getUserFeedback}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService|getUserFeedback}. * @memberof google.cloud.dataqna.v1alpha.QuestionService * @typedef GetUserFeedbackCallback * @type {function} @@ -6068,7 +6453,7 @@ */ /** - * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService#updateUserFeedback}. + * Callback as used by {@link google.cloud.dataqna.v1alpha.QuestionService|updateUserFeedback}. * @memberof google.cloud.dataqna.v1alpha.QuestionService * @typedef UpdateUserFeedbackCallback * @type {function} @@ -6206,12 +6591,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6315,6 +6702,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetQuestionRequest + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.GetQuestionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetQuestionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.GetQuestionRequest"; + }; + return GetQuestionRequest; })(); @@ -6421,12 +6823,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.question = $root.google.cloud.dataqna.v1alpha.Question.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.question = $root.google.cloud.dataqna.v1alpha.Question.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6530,6 +6934,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateQuestionRequest + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.CreateQuestionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateQuestionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.CreateQuestionRequest"; + }; + return CreateQuestionRequest; })(); @@ -6636,12 +7055,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.interpretationIndex = reader.int32(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.interpretationIndex = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -6740,6 +7161,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExecuteQuestionRequest + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.ExecuteQuestionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteQuestionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.ExecuteQuestionRequest"; + }; + return ExecuteQuestionRequest; })(); @@ -6835,9 +7271,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; @@ -6927,6 +7364,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetUserFeedbackRequest + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.GetUserFeedbackRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUserFeedbackRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.GetUserFeedbackRequest"; + }; + return GetUserFeedbackRequest; })(); @@ -7033,12 +7485,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.userFeedback = $root.google.cloud.dataqna.v1alpha.UserFeedback.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.userFeedback = $root.google.cloud.dataqna.v1alpha.UserFeedback.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7147,6 +7601,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateUserFeedbackRequest + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateUserFeedbackRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest"; + }; + return UpdateUserFeedbackRequest; })(); @@ -7264,15 +7733,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.freeFormFeedback = reader.string(); - break; - case 3: - message.rating = reader.int32(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.freeFormFeedback = reader.string(); + break; + } + case 3: { + message.rating = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -7397,6 +7869,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UserFeedback + * @function getTypeUrl + * @memberof google.cloud.dataqna.v1alpha.UserFeedback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataqna.v1alpha.UserFeedback"; + }; + /** * UserFeedbackRating enum. * @name google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating @@ -7539,14 +8026,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; @@ -7662,6 +8151,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; })(); @@ -7872,38 +8376,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; @@ -8125,6 +8639,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; })(); @@ -8231,12 +8760,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; @@ -8335,6 +8866,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; })(); @@ -8529,36 +9075,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; @@ -8756,6 +9309,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 @@ -8892,12 +9460,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; @@ -8996,6 +9566,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; })(); @@ -9105,11 +9690,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; @@ -9216,6 +9802,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; })(); @@ -9237,6 +9838,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 */ /** @@ -9357,6 +9959,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 @@ -9412,6 +10022,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; }; @@ -9446,66 +10058,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; @@ -9617,6 +10245,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; }; @@ -9709,6 +10340,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -9740,6 +10373,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -9786,6 +10420,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; }; @@ -9800,6 +10436,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + return FileDescriptorProto; })(); @@ -10010,52 +10661,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; @@ -10356,6 +11017,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() { /** @@ -10470,15 +11146,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; @@ -10590,6 +11269,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; })(); @@ -10696,12 +11390,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; @@ -10800,6 +11496,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; })(); @@ -10900,11 +11611,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; @@ -11011,6 +11723,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; })(); @@ -11216,39 +11943,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; @@ -11535,6 +12273,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 @@ -11703,12 +12456,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; @@ -11812,6 +12567,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; })(); @@ -11957,27 +12727,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; @@ -12153,6 +12928,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() { /** @@ -12256,12 +13046,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; @@ -12360,6 +13152,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; })(); @@ -12480,15 +13287,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; @@ -12600,6 +13410,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; })(); @@ -12719,17 +13544,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; @@ -12855,8 +13683,23 @@ * @instance * @returns {Object.} JSON object */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; }; return ServiceDescriptorProto; @@ -13009,24 +13852,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; @@ -13162,6 +14011,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; })(); @@ -13492,76 +14356,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; @@ -13874,6 +14760,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 @@ -14042,26 +14943,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; @@ -14215,6 +15122,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; })(); @@ -14228,6 +15150,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 @@ -14284,6 +15207,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -14360,6 +15291,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(); @@ -14405,42 +15338,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; @@ -14500,6 +15446,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"; @@ -14585,6 +15534,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) @@ -14672,6 +15623,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")) @@ -14686,6 +15638,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) @@ -14712,6 +15666,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 @@ -14841,11 +15810,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; @@ -14952,6 +15922,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; })(); @@ -15071,17 +16056,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; @@ -15206,6 +16194,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; })(); @@ -15314,14 +16317,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; @@ -15437,6 +16442,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; })(); @@ -15567,20 +16587,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; @@ -15713,6 +16737,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; })(); @@ -15856,25 +16895,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; @@ -16051,6 +17095,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 @@ -16230,29 +17289,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; @@ -16365,7 +17431,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); @@ -16446,6 +17512,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() { /** @@ -16547,12 +17628,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; @@ -16653,6 +17736,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; })(); @@ -16753,11 +17851,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; @@ -16864,6 +17963,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() { /** @@ -17012,37 +18126,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; @@ -17203,6 +18322,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; })(); @@ -17303,11 +18437,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; @@ -17414,6 +18549,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() { /** @@ -17424,6 +18574,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 */ /** @@ -17474,6 +18625,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 @@ -17510,6 +18669,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; }; @@ -17544,25 +18705,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; @@ -17614,6 +18783,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; }; @@ -17642,6 +18820,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; }; @@ -17664,6 +18856,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -17676,6 +18869,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; }; @@ -17690,6 +18885,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; })(); @@ -17799,12 +19025,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -17866,7 +19094,7 @@ if (object.value != null) if (typeof object.value === "string") $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) + else if (object.value.length >= 0) message.value = object.value; return message; }; @@ -17912,6 +19140,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + return Any; })(); @@ -18018,12 +19261,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; @@ -18136,6 +19381,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; })(); @@ -18233,11 +19493,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; @@ -18339,6 +19600,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; })(); @@ -18470,17 +19746,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.code = reader.int32(); - break; - case 2: - message.message = reader.string(); - break; - case 3: - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -18605,6 +19884,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + return Status; })(); diff --git a/packages/google-cloud-dataqna/protos/protos.json b/packages/google-cloud-dataqna/protos/protos.json index e76b42bbb21..8ebe38d652b 100644 --- a/packages/google-cloud-dataqna/protos/protos.json +++ b/packages/google-cloud-dataqna/protos/protos.json @@ -1025,6 +1025,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -1553,6 +1557,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -1845,6 +1856,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From 4073ba8c16f2da09f12cc99e12a04139f4e7a110 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:04:19 +0000 Subject: [PATCH 65/77] fix: do not import the whole google-gax from proto JS (#1553) (#125) 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-dataqna/package.json | 2 +- packages/google-cloud-dataqna/protos/protos.d.ts | 2 +- packages/google-cloud-dataqna/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index d2c133cb860..c61de3b7134 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -40,7 +40,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-dataqna/protos/protos.d.ts b/packages/google-cloud-dataqna/protos/protos.d.ts index 58b1bcd50cd..e991c21af62 100644 --- a/packages/google-cloud-dataqna/protos/protos.d.ts +++ b/packages/google-cloud-dataqna/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-dataqna/protos/protos.js b/packages/google-cloud-dataqna/protos/protos.js index 25890ae18e7..ee6a65024eb 100644 --- a/packages/google-cloud-dataqna/protos/protos.js +++ b/packages/google-cloud-dataqna/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 67f840fad946714d8edb12a7014ceb472db1521a 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:56:19 +0000 Subject: [PATCH 66/77] fix: allow passing gax instance to client constructor (#126) - [ ] 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 --- .../v1alpha/auto_suggestion_service_client.ts | 33 +++++++++++---- .../src/v1alpha/question_service_client.ts | 41 ++++++++++++++----- 2 files changed, 56 insertions(+), 18 deletions(-) diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index a35f663ca13..1febbbcec6c 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_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 './auto_suggestion_service_client_config.json'; - const version = require('../../../package.json').version; /** @@ -153,8 +157,18 @@ export class AutoSuggestionServiceClient { * 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 AutoSuggestionServiceClient({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 AutoSuggestionServiceClient; @@ -175,8 +189,13 @@ export class AutoSuggestionServiceClient { 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); @@ -245,7 +264,7 @@ export class AutoSuggestionServiceClient { 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; } /** @@ -466,7 +485,7 @@ export class AutoSuggestionServiceClient { 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(); diff --git a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index 1f02a8cd01e..b7205c97047 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_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 './question_service_client_config.json'; - const version = require('../../../package.json').version; /** @@ -102,8 +106,18 @@ export class QuestionServiceClient { * 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 QuestionServiceClient({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 QuestionServiceClient; const servicePath = @@ -123,8 +137,13 @@ export class QuestionServiceClient { 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); @@ -193,7 +212,7 @@ export class QuestionServiceClient { 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; } /** @@ -405,7 +424,7 @@ export class QuestionServiceClient { 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(); @@ -499,7 +518,7 @@ export class QuestionServiceClient { 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(); @@ -593,7 +612,7 @@ export class QuestionServiceClient { 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(); @@ -686,7 +705,7 @@ export class QuestionServiceClient { 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(); @@ -789,7 +808,7 @@ export class QuestionServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'user_feedback.name': request.userFeedback!.name || '', }); this.initialize(); From bee01047c362e4b7b42b8c79d34e88c20430c219 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 18:00:41 -0400 Subject: [PATCH 67/77] chore(main): release 2.0.1 (#119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 2.0.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-dataqna/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-dataqna/package.json | 2 +- ...nippet_metadata.google.cloud.dataqna.v1alpha.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index 6616464e166..6a8abf73eff 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.0.1](https://github.com/googleapis/nodejs-data-qna/compare/v2.0.0...v2.0.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#126](https://github.com/googleapis/nodejs-data-qna/issues/126)) ([8d03113](https://github.com/googleapis/nodejs-data-qna/commit/8d03113db0ef47a09691bbaede4f6234da55200b)) +* Better support for fallback mode ([#122](https://github.com/googleapis/nodejs-data-qna/issues/122)) ([12947ca](https://github.com/googleapis/nodejs-data-qna/commit/12947cab0f97b89d0afc3bb7b84fb124322d9c60)) +* Change import long to require ([#123](https://github.com/googleapis/nodejs-data-qna/issues/123)) ([9b0f93d](https://github.com/googleapis/nodejs-data-qna/commit/9b0f93dee65eda577fa0e7a1d159019dfeba7121)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-data-qna/issues/1553)) ([#125](https://github.com/googleapis/nodejs-data-qna/issues/125)) ([a408179](https://github.com/googleapis/nodejs-data-qna/commit/a408179604ce35e32d3d2233388777abdbba3d3b)) +* **docs:** Document fallback rest option ([#118](https://github.com/googleapis/nodejs-data-qna/issues/118)) ([34380af](https://github.com/googleapis/nodejs-data-qna/commit/34380af413735866ab87d19a10e8edd9517a75de)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-data-qna/issues/1546)) ([#124](https://github.com/googleapis/nodejs-data-qna/issues/124)) ([54ca160](https://github.com/googleapis/nodejs-data-qna/commit/54ca16066ca21f6d3d990469044873beba4390e2)) + ## [2.0.0](https://github.com/googleapis/nodejs-data-qna/compare/v1.1.0...v2.0.0) (2022-06-10) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index c61de3b7134..a4c37ebda31 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "2.0.0", + "version": "2.0.1", "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json index 6b4289621f2..9007a08b14f 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataqna", - "version": "2.0.0", + "version": "2.0.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index 3b21af9a272..c16bb71ac60 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^2.0.0" + "@google-cloud/data-qna": "^2.0.1" }, "devDependencies": { "c8": "^7.1.0", From edf47cca78b95e8965d055b62a1a5a363ff509c0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:40:35 +0000 Subject: [PATCH 68/77] fix: preserve default values in x-goog-request-params header (#127) - [ ] 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 --- .../v1alpha/auto_suggestion_service_client.ts | 2 +- .../src/v1alpha/question_service_client.ts | 10 +- .../gapic_auto_suggestion_service_v1alpha.ts | 101 ++-- .../test/gapic_question_service_v1alpha.ts | 449 +++++++++--------- 4 files changed, 294 insertions(+), 268 deletions(-) diff --git a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts index 1febbbcec6c..e2e1604e4bd 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/auto_suggestion_service_client.ts @@ -486,7 +486,7 @@ export class AutoSuggestionServiceClient { 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.suggestQueries(request, options, callback); diff --git a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts index b7205c97047..8a9bb1fc565 100644 --- a/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts +++ b/packages/google-cloud-dataqna/src/v1alpha/question_service_client.ts @@ -425,7 +425,7 @@ export class QuestionServiceClient { 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.getQuestion(request, options, callback); @@ -519,7 +519,7 @@ export class QuestionServiceClient { 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.createQuestion(request, options, callback); @@ -613,7 +613,7 @@ export class QuestionServiceClient { 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.executeQuestion(request, options, callback); @@ -706,7 +706,7 @@ export class QuestionServiceClient { 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.getUserFeedback(request, options, callback); @@ -809,7 +809,7 @@ export class QuestionServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'user_feedback.name': request.userFeedback!.name || '', + 'user_feedback.name': request.userFeedback!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateUserFeedback(request, options, callback); diff --git a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts index 91ad45cbbdf..f21687427d5 100644 --- a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts @@ -25,6 +25,21 @@ import * as autosuggestionserviceModule 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 @@ -170,26 +185,25 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SuggestQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesResponse() ); client.innerApiCalls.suggestQueries = stubSimpleCall(expectedResponse); const [response] = await client.suggestQueries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.suggestQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.suggestQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suggestQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes suggestQueries without error using callback', async () => { @@ -202,15 +216,11 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SuggestQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesResponse() ); @@ -233,11 +243,14 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.suggestQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.suggestQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suggestQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes suggestQueries with error', async () => { @@ -250,26 +263,25 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SuggestQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.suggestQueries = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.suggestQueries(request), expectedError); - assert( - (client.innerApiCalls.suggestQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.suggestQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suggestQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes suggestQueries with closed client', async () => { @@ -282,7 +294,10 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('SuggestQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.suggestQueries(request), expectedError); diff --git a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts index dae06205f41..18d792cb7cf 100644 --- a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts @@ -25,6 +25,21 @@ import * as questionserviceModule 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 @@ -159,26 +174,23 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetQuestionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.Question() ); client.innerApiCalls.getQuestion = stubSimpleCall(expectedResponse); const [response] = await client.getQuestion(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getQuestion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getQuestion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuestion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getQuestion without error using callback', async () => { @@ -190,15 +202,9 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetQuestionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.Question() ); @@ -221,11 +227,14 @@ describe('v1alpha.QuestionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getQuestion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getQuestion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuestion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getQuestion with error', async () => { @@ -237,26 +246,23 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetQuestionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getQuestion = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getQuestion(request), expectedError); - assert( - (client.innerApiCalls.getQuestion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getQuestion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuestion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getQuestion with closed client', async () => { @@ -268,7 +274,8 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetQuestionRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getQuestion(request), expectedError); @@ -285,26 +292,25 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateQuestionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.Question() ); client.innerApiCalls.createQuestion = stubSimpleCall(expectedResponse); const [response] = await client.createQuestion(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createQuestion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createQuestion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createQuestion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createQuestion without error using callback', async () => { @@ -316,15 +322,11 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateQuestionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.Question() ); @@ -347,11 +349,14 @@ describe('v1alpha.QuestionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createQuestion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createQuestion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createQuestion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createQuestion with error', async () => { @@ -363,26 +368,25 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateQuestionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createQuestion = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createQuestion(request), expectedError); - assert( - (client.innerApiCalls.createQuestion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createQuestion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createQuestion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createQuestion with closed client', async () => { @@ -394,7 +398,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateQuestionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createQuestion(request), expectedError); @@ -411,26 +418,25 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ExecuteQuestionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.Question() ); client.innerApiCalls.executeQuestion = stubSimpleCall(expectedResponse); const [response] = await client.executeQuestion(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.executeQuestion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.executeQuestion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeQuestion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes executeQuestion without error using callback', async () => { @@ -442,15 +448,11 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ExecuteQuestionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.Question() ); @@ -473,11 +475,14 @@ describe('v1alpha.QuestionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.executeQuestion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.executeQuestion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeQuestion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes executeQuestion with error', async () => { @@ -489,26 +494,25 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ExecuteQuestionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.executeQuestion = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.executeQuestion(request), expectedError); - assert( - (client.innerApiCalls.executeQuestion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.executeQuestion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeQuestion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes executeQuestion with closed client', async () => { @@ -520,7 +524,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('ExecuteQuestionRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.executeQuestion(request), expectedError); @@ -537,26 +544,25 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetUserFeedbackRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.UserFeedback() ); client.innerApiCalls.getUserFeedback = stubSimpleCall(expectedResponse); const [response] = await client.getUserFeedback(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getUserFeedback as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getUserFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getUserFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getUserFeedback without error using callback', async () => { @@ -568,15 +574,11 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetUserFeedbackRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.UserFeedback() ); @@ -599,11 +601,14 @@ describe('v1alpha.QuestionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getUserFeedback as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getUserFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getUserFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getUserFeedback with error', async () => { @@ -615,26 +620,25 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetUserFeedbackRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getUserFeedback = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getUserFeedback(request), expectedError); - assert( - (client.innerApiCalls.getUserFeedback as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getUserFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getUserFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getUserFeedback with closed client', async () => { @@ -646,7 +650,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetUserFeedbackRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getUserFeedback(request), expectedError); @@ -663,16 +670,13 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() ); - request.userFeedback = {}; - request.userFeedback.name = ''; - const expectedHeaderRequestParams = 'user_feedback.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.userFeedback ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateUserFeedbackRequest', [ + 'userFeedback', + 'name', + ]); + request.userFeedback.name = defaultValue1; + const expectedHeaderRequestParams = `user_feedback.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.UserFeedback() ); @@ -680,11 +684,14 @@ describe('v1alpha.QuestionServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateUserFeedback(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateUserFeedback as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateUserFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateUserFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateUserFeedback without error using callback', async () => { @@ -696,16 +703,13 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() ); - request.userFeedback = {}; - request.userFeedback.name = ''; - const expectedHeaderRequestParams = 'user_feedback.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.userFeedback ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateUserFeedbackRequest', [ + 'userFeedback', + 'name', + ]); + request.userFeedback.name = defaultValue1; + const expectedHeaderRequestParams = `user_feedback.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.UserFeedback() ); @@ -728,11 +732,14 @@ describe('v1alpha.QuestionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateUserFeedback as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateUserFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateUserFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateUserFeedback with error', async () => { @@ -744,27 +751,27 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() ); - request.userFeedback = {}; - request.userFeedback.name = ''; - const expectedHeaderRequestParams = 'user_feedback.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.userFeedback ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateUserFeedbackRequest', [ + 'userFeedback', + 'name', + ]); + request.userFeedback.name = defaultValue1; + const expectedHeaderRequestParams = `user_feedback.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateUserFeedback = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateUserFeedback(request), expectedError); - assert( - (client.innerApiCalls.updateUserFeedback as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateUserFeedback as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateUserFeedback as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateUserFeedback with closed client', async () => { @@ -776,8 +783,12 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() ); - request.userFeedback = {}; - request.userFeedback.name = ''; + request.userFeedback ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateUserFeedbackRequest', [ + 'userFeedback', + 'name', + ]); + request.userFeedback.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateUserFeedback(request), expectedError); From 2d80eed21f69de6960761bfecc8cff34e055cffb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 14:03:20 -0700 Subject: [PATCH 69/77] test: use fully qualified request type name in tests (#129) 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_auto_suggestion_service_v1alpha.ts | 28 ++-- .../test/gapic_question_service_v1alpha.ts | 136 ++++++++++-------- 2 files changed, 96 insertions(+), 68 deletions(-) diff --git a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts index f21687427d5..a0ff94afa14 100644 --- a/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_auto_suggestion_service_v1alpha.ts @@ -185,9 +185,10 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() ); - const defaultValue1 = getTypeDefaultValue('SuggestQueriesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.SuggestQueriesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -216,9 +217,10 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() ); - const defaultValue1 = getTypeDefaultValue('SuggestQueriesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.SuggestQueriesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -263,9 +265,10 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() ); - const defaultValue1 = getTypeDefaultValue('SuggestQueriesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.SuggestQueriesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -294,9 +297,10 @@ describe('v1alpha.AutoSuggestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.SuggestQueriesRequest() ); - const defaultValue1 = getTypeDefaultValue('SuggestQueriesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.SuggestQueriesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); diff --git a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts index 18d792cb7cf..8cb5068188a 100644 --- a/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts +++ b/packages/google-cloud-dataqna/test/gapic_question_service_v1alpha.ts @@ -174,7 +174,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('GetQuestionRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.GetQuestionRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -202,7 +205,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('GetQuestionRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.GetQuestionRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -246,7 +252,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('GetQuestionRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.GetQuestionRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -274,7 +283,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('GetQuestionRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.GetQuestionRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -292,9 +304,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateQuestionRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.CreateQuestionRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -322,9 +335,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateQuestionRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.CreateQuestionRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -368,9 +382,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateQuestionRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.CreateQuestionRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -398,9 +413,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.CreateQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateQuestionRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.CreateQuestionRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -418,9 +434,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('ExecuteQuestionRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -448,9 +465,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('ExecuteQuestionRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -494,9 +512,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('ExecuteQuestionRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -524,9 +543,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest() ); - const defaultValue1 = getTypeDefaultValue('ExecuteQuestionRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.ExecuteQuestionRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -544,9 +564,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() ); - const defaultValue1 = getTypeDefaultValue('GetUserFeedbackRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -574,9 +595,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() ); - const defaultValue1 = getTypeDefaultValue('GetUserFeedbackRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -620,9 +642,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() ); - const defaultValue1 = getTypeDefaultValue('GetUserFeedbackRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -650,9 +673,10 @@ describe('v1alpha.QuestionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest() ); - const defaultValue1 = getTypeDefaultValue('GetUserFeedbackRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.GetUserFeedbackRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -671,10 +695,10 @@ describe('v1alpha.QuestionServiceClient', () => { new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() ); request.userFeedback ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateUserFeedbackRequest', [ - 'userFeedback', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest', + ['userFeedback', 'name'] + ); request.userFeedback.name = defaultValue1; const expectedHeaderRequestParams = `user_feedback.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -704,10 +728,10 @@ describe('v1alpha.QuestionServiceClient', () => { new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() ); request.userFeedback ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateUserFeedbackRequest', [ - 'userFeedback', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest', + ['userFeedback', 'name'] + ); request.userFeedback.name = defaultValue1; const expectedHeaderRequestParams = `user_feedback.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -752,10 +776,10 @@ describe('v1alpha.QuestionServiceClient', () => { new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() ); request.userFeedback ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateUserFeedbackRequest', [ - 'userFeedback', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest', + ['userFeedback', 'name'] + ); request.userFeedback.name = defaultValue1; const expectedHeaderRequestParams = `user_feedback.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -784,10 +808,10 @@ describe('v1alpha.QuestionServiceClient', () => { new protos.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest() ); request.userFeedback ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateUserFeedbackRequest', [ - 'userFeedback', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataqna.v1alpha.UpdateUserFeedbackRequest', + ['userFeedback', 'name'] + ); request.userFeedback.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); From 9dba2c12f020a36e1fa17c4116d93af9b8062276 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 Nov 2022 23:44:15 -0700 Subject: [PATCH 70/77] fix(deps): use google-gax v3.5.2 (#133) --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index a4c37ebda31..8c90d6955a7 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -40,7 +40,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^3.3.0" + "google-gax": "^3.5.2" }, "devDependencies": { "@types/mocha": "^9.0.0", From 514816573ae7874b11582d8e03962d7b3133bcd1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 10:36:28 +0100 Subject: [PATCH 71/77] chore(deps): update dependency @types/node to v18 (#131) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^16.0.0` -> `^18.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/16.18.3/18.11.9) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/compatibility-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/confidence-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 8c90d6955a7..53485f83ffb 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -44,7 +44,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "c8": "^7.3.5", "gts": "^3.1.0", From a8f4a535578385aec70a87b6cdf6de0cb37aeb63 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 11:16:25 +0100 Subject: [PATCH 72/77] chore(deps): update dependency jsdoc to v4 (#135) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc](https://togithub.com/jsdoc/jsdoc) | [`^3.6.6` -> `^4.0.0`](https://renovatebot.com/diffs/npm/jsdoc/3.6.11/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/compatibility-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/confidence-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
jsdoc/jsdoc ### [`v4.0.0`](https://togithub.com/jsdoc/jsdoc/blob/HEAD/CHANGES.md#​400-November-2022) [Compare Source](https://togithub.com/jsdoc/jsdoc/compare/3.6.11...084218523a7d69fec14a852ce680f374f526af28) - JSDoc releases now use [semantic versioning](https://semver.org/). If JSDoc makes backwards-incompatible changes in the future, the major version will be incremented. - JSDoc no longer uses the [`taffydb`](https://taffydb.com/) package. If your JSDoc template or plugin uses the `taffydb` package, see the [instructions for replacing `taffydb` with `@jsdoc/salty`](https://togithub.com/jsdoc/jsdoc/tree/main/packages/jsdoc-salty#use-salty-in-a-jsdoc-template). - JSDoc now supports Node.js 12.0.0 and later.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-qna). --- packages/google-cloud-dataqna/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 53485f83ffb..431d4b0754b 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -48,7 +48,7 @@ "@types/sinon": "^10.0.0", "c8": "^7.3.5", "gts": "^3.1.0", - "jsdoc": "^3.6.6", + "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^4.0.0", From 55ad073df0623cedc9b21e6a47c6458d683d58b4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 11:12:17 +0000 Subject: [PATCH 73/77] fix: regenerated protos JS and TS definitions (#136) samples: pull in latest typeless bot, clean up some comments Source-Link: https://togithub.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e --- .../google-cloud-dataqna/protos/protos.d.ts | 2 +- .../google-cloud-dataqna/protos/protos.js | 134 +++++++++++++++--- 2 files changed, 117 insertions(+), 19 deletions(-) diff --git a/packages/google-cloud-dataqna/protos/protos.d.ts b/packages/google-cloud-dataqna/protos/protos.d.ts index e991c21af62..c1f70ff01ee 100644 --- a/packages/google-cloud-dataqna/protos/protos.d.ts +++ b/packages/google-cloud-dataqna/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-dataqna/protos/protos.js b/packages/google-cloud-dataqna/protos/protos.js index ee6a65024eb..a485e79fa9c 100644 --- a/packages/google-cloud-dataqna/protos/protos.js +++ b/packages/google-cloud-dataqna/protos/protos.js @@ -531,6 +531,12 @@ return object; var message = new $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkup(); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "MARKUP_TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -586,7 +592,7 @@ object.length = 0; } if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkupType[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkupType[message.type] === undefined ? message.type : $root.google.cloud.dataqna.v1alpha.AnnotatedString.SemanticMarkupType[message.type] : message.type; if (message.startCharIndex != null && message.hasOwnProperty("startCharIndex")) object.startCharIndex = message.startCharIndex; if (message.length != null && message.hasOwnProperty("length")) @@ -969,6 +975,10 @@ for (var i = 0; i < object.suggestionTypes.length; ++i) switch (object.suggestionTypes[i]) { default: + if (typeof object.suggestionTypes[i] === "number") { + message.suggestionTypes[i] = object.suggestionTypes[i]; + break; + } case "SUGGESTION_TYPE_UNSPECIFIED": case 0: message.suggestionTypes[i] = 0; @@ -1019,7 +1029,7 @@ if (message.suggestionTypes && message.suggestionTypes.length) { object.suggestionTypes = []; for (var j = 0; j < message.suggestionTypes.length; ++j) - object.suggestionTypes[j] = options.enums === String ? $root.google.cloud.dataqna.v1alpha.SuggestionType[message.suggestionTypes[j]] : message.suggestionTypes[j]; + object.suggestionTypes[j] = options.enums === String ? $root.google.cloud.dataqna.v1alpha.SuggestionType[message.suggestionTypes[j]] === undefined ? message.suggestionTypes[j] : $root.google.cloud.dataqna.v1alpha.SuggestionType[message.suggestionTypes[j]] : message.suggestionTypes[j]; } return object; }; @@ -1254,6 +1264,12 @@ if (object.rankingScore != null) message.rankingScore = Number(object.rankingScore); switch (object.suggestionType) { + default: + if (typeof object.suggestionType === "number") { + message.suggestionType = object.suggestionType; + break; + } + break; case "SUGGESTION_TYPE_UNSPECIFIED": case 0: message.suggestionType = 0; @@ -1293,7 +1309,7 @@ if (message.rankingScore != null && message.hasOwnProperty("rankingScore")) object.rankingScore = options.json && !isFinite(message.rankingScore) ? String(message.rankingScore) : message.rankingScore; if (message.suggestionType != null && message.hasOwnProperty("suggestionType")) - object.suggestionType = options.enums === String ? $root.google.cloud.dataqna.v1alpha.SuggestionType[message.suggestionType] : message.suggestionType; + object.suggestionType = options.enums === String ? $root.google.cloud.dataqna.v1alpha.SuggestionType[message.suggestionType] === undefined ? message.suggestionType : $root.google.cloud.dataqna.v1alpha.SuggestionType[message.suggestionType] : message.suggestionType; return object; }; @@ -2729,6 +2745,12 @@ if (object.message != null) message.message = String(object.message); switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; case "INTERPRET_ERROR_CODE_UNSPECIFIED": case 0: message.code = 0; @@ -2775,7 +2797,7 @@ if (message.message != null && message.hasOwnProperty("message")) object.message = message.message; if (message.code != null && message.hasOwnProperty("code")) - object.code = options.enums === String ? $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorCode[message.code] : message.code; + object.code = options.enums === String ? $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorCode[message.code] === undefined ? message.code : $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorCode[message.code] : message.code; if (message.details != null && message.hasOwnProperty("details")) object.details = $root.google.cloud.dataqna.v1alpha.InterpretError.InterpretErrorDetails.toObject(message.details, options); return object; @@ -3509,6 +3531,10 @@ for (var i = 0; i < object.entities.length; ++i) switch (object.entities[i]) { default: + if (typeof object.entities[i] === "number") { + message.entities[i] = object.entities[i]; + break; + } case "INTERPRET_ENTITY_UNSPECIFIED": case 0: message.entities[i] = 0; @@ -3544,7 +3570,7 @@ if (message.entities && message.entities.length) { object.entities = []; for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = options.enums === String ? $root.google.cloud.dataqna.v1alpha.InterpretEntity[message.entities[j]] : message.entities[j]; + object.entities[j] = options.enums === String ? $root.google.cloud.dataqna.v1alpha.InterpretEntity[message.entities[j]] === undefined ? message.entities[j] : $root.google.cloud.dataqna.v1alpha.InterpretEntity[message.entities[j]] : message.entities[j]; } return object; }; @@ -3997,6 +4023,12 @@ message.jobCreationStatus = $root.google.rpc.Status.fromObject(object.jobCreationStatus); } switch (object.jobExecutionState) { + default: + if (typeof object.jobExecutionState === "number") { + message.jobExecutionState = object.jobExecutionState; + break; + } + break; case "JOB_EXECUTION_STATE_UNSPECIFIED": case 0: message.jobExecutionState = 0; @@ -4053,7 +4085,7 @@ if (message.jobCreationStatus != null && message.hasOwnProperty("jobCreationStatus")) object.jobCreationStatus = $root.google.rpc.Status.toObject(message.jobCreationStatus, options); if (message.jobExecutionState != null && message.hasOwnProperty("jobExecutionState")) - object.jobExecutionState = options.enums === String ? $root.google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState[message.jobExecutionState] : message.jobExecutionState; + object.jobExecutionState = options.enums === String ? $root.google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState[message.jobExecutionState] === undefined ? message.jobExecutionState : $root.google.cloud.dataqna.v1alpha.ExecutionInfo.JobExecutionState[message.jobExecutionState] : message.jobExecutionState; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.bigqueryJob != null && message.hasOwnProperty("bigqueryJob")) @@ -5412,6 +5444,10 @@ for (var i = 0; i < object.visualizationTypes.length; ++i) switch (object.visualizationTypes[i]) { default: + if (typeof object.visualizationTypes[i] === "number") { + message.visualizationTypes[i] = object.visualizationTypes[i]; + break; + } case "VISUALIZATION_TYPE_UNSPECIFIED": case 0: message.visualizationTypes[i] = 0; @@ -5499,7 +5535,7 @@ if (message.visualizationTypes && message.visualizationTypes.length) { object.visualizationTypes = []; for (var j = 0; j < message.visualizationTypes.length; ++j) - object.visualizationTypes[j] = options.enums === String ? $root.google.cloud.dataqna.v1alpha.InterpretationStructure.VisualizationType[message.visualizationTypes[j]] : message.visualizationTypes[j]; + object.visualizationTypes[j] = options.enums === String ? $root.google.cloud.dataqna.v1alpha.InterpretationStructure.VisualizationType[message.visualizationTypes[j]] === undefined ? message.visualizationTypes[j] : $root.google.cloud.dataqna.v1alpha.InterpretationStructure.VisualizationType[message.visualizationTypes[j]] : message.visualizationTypes[j]; } if (message.columnInfo && message.columnInfo.length) { object.columnInfo = []; @@ -7815,6 +7851,12 @@ if (object.freeFormFeedback != null) message.freeFormFeedback = String(object.freeFormFeedback); switch (object.rating) { + default: + if (typeof object.rating === "number") { + message.rating = object.rating; + break; + } + break; case "USER_FEEDBACK_RATING_UNSPECIFIED": case 0: message.rating = 0; @@ -7854,7 +7896,7 @@ if (message.freeFormFeedback != null && message.hasOwnProperty("freeFormFeedback")) object.freeFormFeedback = message.freeFormFeedback; if (message.rating != null && message.hasOwnProperty("rating")) - object.rating = options.enums === String ? $root.google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating[message.rating] : message.rating; + object.rating = options.enums === String ? $root.google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating[message.rating] === undefined ? message.rating : $root.google.cloud.dataqna.v1alpha.UserFeedback.UserFeedbackRating[message.rating] : message.rating; return object; }; @@ -9214,6 +9256,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; @@ -9238,6 +9286,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; @@ -9285,7 +9337,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")) @@ -9293,7 +9345,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; }; @@ -12104,6 +12156,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; @@ -12118,6 +12176,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; @@ -12244,9 +12308,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")) @@ -14593,6 +14657,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; @@ -14701,7 +14771,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")) @@ -15503,6 +15573,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; @@ -15519,6 +15595,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; @@ -15557,6 +15639,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; @@ -15627,7 +15713,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")) @@ -15635,7 +15721,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")) @@ -15648,7 +15734,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); @@ -17005,6 +17091,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; @@ -17068,7 +17160,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) @@ -18821,6 +18913,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; @@ -18870,7 +18968,7 @@ if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; return object; }; From d04f86895a2e1c0f639df449dc9f9c76f9bfca28 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 18:10:59 -0800 Subject: [PATCH 74/77] chore(main): release 2.0.2 (#128) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 2.0.2 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-dataqna/CHANGELOG.md | 9 +++++++++ packages/google-cloud-dataqna/package.json | 2 +- .../snippet_metadata.google.cloud.dataqna.v1alpha.json | 2 +- packages/google-cloud-dataqna/samples/package.json | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-dataqna/CHANGELOG.md b/packages/google-cloud-dataqna/CHANGELOG.md index 6a8abf73eff..613bbf7bc12 100644 --- a/packages/google-cloud-dataqna/CHANGELOG.md +++ b/packages/google-cloud-dataqna/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.0.2](https://github.com/googleapis/nodejs-data-qna/compare/v2.0.1...v2.0.2) (2022-11-10) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#133](https://github.com/googleapis/nodejs-data-qna/issues/133)) ([22faab9](https://github.com/googleapis/nodejs-data-qna/commit/22faab9ab9bcaee1c4bd71f7fce4ba8a1a824aa7)) +* Preserve default values in x-goog-request-params header ([#127](https://github.com/googleapis/nodejs-data-qna/issues/127)) ([0bd099f](https://github.com/googleapis/nodejs-data-qna/commit/0bd099f012c187b567465812db08533cc624b755)) +* Regenerated protos JS and TS definitions ([#136](https://github.com/googleapis/nodejs-data-qna/issues/136)) ([7f5f180](https://github.com/googleapis/nodejs-data-qna/commit/7f5f180f250a347dddb9fc95baaa2b5337e16fcf)) + ## [2.0.1](https://github.com/googleapis/nodejs-data-qna/compare/v2.0.0...v2.0.1) (2022-09-01) diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 431d4b0754b..9a1f3e4aeb5 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-qna", - "version": "2.0.1", + "version": "2.0.2", "description": "Dataqna client for Node.js", "repository": "googleapis/nodejs-data-qna", "license": "Apache-2.0", diff --git a/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json index 9007a08b14f..e5121f2b8ec 100644 --- a/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json +++ b/packages/google-cloud-dataqna/samples/generated/v1alpha/snippet_metadata.google.cloud.dataqna.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataqna", - "version": "2.0.1", + "version": "2.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index c16bb71ac60..7006b9de226 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-qna": "^2.0.1" + "@google-cloud/data-qna": "^2.0.2" }, "devDependencies": { "c8": "^7.1.0", From 53adee537741721b82cc1170f26ae75d4d1194f1 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Fri, 11 Nov 2022 02:13:16 -0800 Subject: [PATCH 75/77] build: add release-please config, fix owlbot-config --- .release-please-manifest.json | 1 + .../{.github => }/.OwlBot.yaml | 6 +- packages/google-cloud-dataqna/.mocharc.js | 2 +- packages/google-cloud-dataqna/.prettierrc.js | 2 +- .../google-cloud-dataqna/.repo-metadata.json | 4 +- packages/google-cloud-dataqna/README.md | 28 ++- packages/google-cloud-dataqna/package.json | 13 +- .../google-cloud-dataqna/samples/README.md | 176 ++++++++++++++++++ packages/google-cloud-dataqna/src/index.ts | 2 +- release-please-config.json | 3 +- 10 files changed, 217 insertions(+), 20 deletions(-) rename packages/google-cloud-dataqna/{.github => }/.OwlBot.yaml (81%) create mode 100644 packages/google-cloud-dataqna/samples/README.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c38b0a70276..411d0ea4431 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -16,6 +16,7 @@ "packages/google-cloud-contentwarehouse": "0.1.2", "packages/google-cloud-dataplex": "2.2.2", "packages/google-cloud-dataproc": "4.1.1", + "packages/google-cloud-dataqna": "2.0.2", "packages/google-cloud-deploy": "2.2.2", "packages/google-cloud-discoveryengine": "0.2.0", "packages/google-cloud-gkeconnect-gateway": "2.0.5", diff --git a/packages/google-cloud-dataqna/.github/.OwlBot.yaml b/packages/google-cloud-dataqna/.OwlBot.yaml similarity index 81% rename from packages/google-cloud-dataqna/.github/.OwlBot.yaml rename to packages/google-cloud-dataqna/.OwlBot.yaml index 43db43f58d0..f1ce238009d 100644 --- a/packages/google-cloud-dataqna/.github/.OwlBot.yaml +++ b/packages/google-cloud-dataqna/.OwlBot.yaml @@ -11,15 +11,13 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest deep-remove-regex: - /owl-bot-staging deep-copy-regex: - - source: /google/cloud/dataqna/(.*)/.*-nodejs/(.*) - dest: /owl-bot-staging/$1/$2 + - source: /google/cloud/dataqna/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-dataqna/$1 begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b diff --git a/packages/google-cloud-dataqna/.mocharc.js b/packages/google-cloud-dataqna/.mocharc.js index 0b600509bed..cdb7b752160 100644 --- a/packages/google-cloud-dataqna/.mocharc.js +++ b/packages/google-cloud-dataqna/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dataqna/.prettierrc.js b/packages/google-cloud-dataqna/.prettierrc.js index d1b95106f4c..d546a4ad546 100644 --- a/packages/google-cloud-dataqna/.prettierrc.js +++ b/packages/google-cloud-dataqna/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dataqna/.repo-metadata.json b/packages/google-cloud-dataqna/.repo-metadata.json index 9964a6e9977..2447288b56b 100644 --- a/packages/google-cloud-dataqna/.repo-metadata.json +++ b/packages/google-cloud-dataqna/.repo-metadata.json @@ -2,7 +2,7 @@ "language": "nodejs", "requires_billing": true, "product_documentation": "https://cloud.google.com/bigquery/docs", - "repo": "googleapis/nodejs-data-qna", + "repo": "googleapis/google-cloud-node", "default_version": "v1alpha", "name_pretty": "Data QnA", "release_level": "preview", @@ -10,7 +10,7 @@ "name": "dataqna", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/data-qna/latest", "api_id": "dataqna.googleapis.com", - "issue_tracker": "https://github.com/googleapis/nodejs-data-qna/issues", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", "api_shortname": "dataqna", "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index a8a1be5f2d4..7c6af07a712 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Data QnA: Node.js Client](https://github.com/googleapis/nodejs-data-qna) +# [Data QnA: Node.js Client](https://github.com/googleapis/google-cloud-node) [![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/data-qna.svg)](https://www.npmjs.org/package/@google-cloud/data-qna) @@ -14,11 +14,11 @@ Dataqna client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-data-qna/blob/main/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dataqna/CHANGELOG.md). * [Data QnA Node.js Client API Reference][client-docs] * [Data QnA Documentation][product-docs] -* [github.com/googleapis/nodejs-data-qna](https://github.com/googleapis/nodejs-data-qna) +* [github.com/googleapis/google-cloud-node/packages/google-cloud-dataqna](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dataqna) Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. @@ -32,7 +32,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. * [Before you begin](#before-you-begin) * [Installing the client library](#installing-the-client-library) - +* [Samples](#samples) * [Versioning](#versioning) * [Contributing](#contributing) * [License](#license) @@ -56,6 +56,22 @@ npm install @google-cloud/data-qna +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Auto_suggestion_service.suggest_queries | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js,samples/README.md) | +| Question_service.create_question | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.create_question.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.create_question.js,samples/README.md) | +| Question_service.execute_question | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.execute_question.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.execute_question.js,samples/README.md) | +| Question_service.get_question | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_question.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_question.js,samples/README.md) | +| Question_service.get_user_feedback | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_user_feedback.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_user_feedback.js,samples/README.md) | +| Question_service.update_user_feedback | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.update_user_feedback.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.update_user_feedback.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) | +| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.test.js,samples/README.md) | + + The [Data QnA Node.js Client API Reference][client-docs] documentation also contains samples. @@ -102,7 +118,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-data-qna/blob/main/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). Please note that this `README.md`, the `samples/README.md`, and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) @@ -114,7 +130,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-data-qna/blob/main/LICENSE) +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/data-qna/latest [product-docs]: https://cloud.google.com/bigquery/docs diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 9a1f3e4aeb5..eec6d4ff1a9 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -2,7 +2,11 @@ "name": "@google-cloud/data-qna", "version": "2.0.2", "description": "Dataqna client for Node.js", - "repository": "googleapis/nodejs-data-qna", + "repository": { + "type": "git", + "directory": "packages/google-cloud-dataqna", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, "license": "Apache-2.0", "author": "Google LLC", "main": "build/src/index.js", @@ -34,9 +38,9 @@ "fix": "gts fix", "prelint": "cd samples; npm link ../; npm i", "lint": "gts check", - "samples-test": "cd samples/ && npm link ../ && npm test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", + "system-test": "npm run compile && c8 mocha build/system-test", "test": "c8 mocha build/test" }, "dependencies": { @@ -63,5 +67,6 @@ }, "engines": { "node": ">=12.0.0" - } + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dataqna" } diff --git a/packages/google-cloud-dataqna/samples/README.md b/packages/google-cloud-dataqna/samples/README.md new file mode 100644 index 00000000000..dda41b237c4 --- /dev/null +++ b/packages/google-cloud-dataqna/samples/README.md @@ -0,0 +1,176 @@ +[//]: # "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 + +# [Data QnA: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Auto_suggestion_service.suggest_queries](#auto_suggestion_service.suggest_queries) + * [Question_service.create_question](#question_service.create_question) + * [Question_service.execute_question](#question_service.execute_question) + * [Question_service.get_question](#question_service.get_question) + * [Question_service.get_user_feedback](#question_service.get_user_feedback) + * [Question_service.update_user_feedback](#question_service.update_user_feedback) + * [Quickstart](#quickstart) + * [Quickstart.test](#quickstart.test) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Auto_suggestion_service.suggest_queries + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js` + + +----- + + + + +### Question_service.create_question + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.create_question.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.create_question.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1alpha/question_service.create_question.js` + + +----- + + + + +### Question_service.execute_question + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.execute_question.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.execute_question.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1alpha/question_service.execute_question.js` + + +----- + + + + +### Question_service.get_question + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_question.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_question.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_question.js` + + +----- + + + + +### Question_service.get_user_feedback + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_user_feedback.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_user_feedback.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_user_feedback.js` + + +----- + + + + +### Question_service.update_user_feedback + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.update_user_feedback.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.update_user_feedback.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1alpha/question_service.update_user_feedback.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/quickstart.js` + + +----- + + + + +### Quickstart.test + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.test.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.test.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/test/quickstart.test.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/bigquery/docs diff --git a/packages/google-cloud-dataqna/src/index.ts b/packages/google-cloud-dataqna/src/index.ts index 9bed8712a80..bc360cd8670 100644 --- a/packages/google-cloud-dataqna/src/index.ts +++ b/packages/google-cloud-dataqna/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/release-please-config.json b/release-please-config.json index ca8fb90627b..5cf15009311 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -17,6 +17,7 @@ "packages/google-cloud-contentwarehouse": {}, "packages/google-cloud-dataplex": {}, "packages/google-cloud-dataproc": {}, + "packages/google-cloud-dataqna": {}, "packages/google-cloud-deploy": {}, "packages/google-cloud-discoveryengine": {}, "packages/google-cloud-gkeconnect-gateway": {}, @@ -49,4 +50,4 @@ } ], "release-type": "node" -} \ No newline at end of file +} From ca3d199d99704103a7547f7746ec1f2cac3d4c1e Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 11 Nov 2022 10:35:27 +0000 Subject: [PATCH 76/77] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- packages/google-cloud-dataqna/README.md | 16 +++---- .../google-cloud-dataqna/samples/README.md | 48 +++++++++---------- release-please-config.json | 2 +- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/packages/google-cloud-dataqna/README.md b/packages/google-cloud-dataqna/README.md index 7c6af07a712..19654ecf2e5 100644 --- a/packages/google-cloud-dataqna/README.md +++ b/packages/google-cloud-dataqna/README.md @@ -62,14 +62,14 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Auto_suggestion_service.suggest_queries | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js,samples/README.md) | -| Question_service.create_question | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.create_question.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.create_question.js,samples/README.md) | -| Question_service.execute_question | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.execute_question.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.execute_question.js,samples/README.md) | -| Question_service.get_question | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_question.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_question.js,samples/README.md) | -| Question_service.get_user_feedback | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_user_feedback.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_user_feedback.js,samples/README.md) | -| Question_service.update_user_feedback | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.update_user_feedback.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.update_user_feedback.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) | -| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.test.js,samples/README.md) | +| Auto_suggestion_service.suggest_queries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js,samples/README.md) | +| Question_service.create_question | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js,samples/README.md) | +| Question_service.execute_question | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js,samples/README.md) | +| Question_service.get_question | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js,samples/README.md) | +| Question_service.get_user_feedback | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js,samples/README.md) | +| Question_service.update_user_feedback | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/quickstart.js,samples/README.md) | +| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/test/quickstart.test.js,samples/README.md) | diff --git a/packages/google-cloud-dataqna/samples/README.md b/packages/google-cloud-dataqna/samples/README.md index dda41b237c4..6ffbe540049 100644 --- a/packages/google-cloud-dataqna/samples/README.md +++ b/packages/google-cloud-dataqna/samples/README.md @@ -38,14 +38,14 @@ Before running the samples, make sure you've followed the steps outlined in ### Auto_suggestion_service.suggest_queries -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js` +`node packages/google-cloud-dataqna/samples/generated/v1alpha/auto_suggestion_service.suggest_queries.js` ----- @@ -55,14 +55,14 @@ __Usage:__ ### Question_service.create_question -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.create_question.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.create_question.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1alpha/question_service.create_question.js` +`node packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.create_question.js` ----- @@ -72,14 +72,14 @@ __Usage:__ ### Question_service.execute_question -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.execute_question.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.execute_question.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1alpha/question_service.execute_question.js` +`node packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.execute_question.js` ----- @@ -89,14 +89,14 @@ __Usage:__ ### Question_service.get_question -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_question.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_question.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_question.js` +`node packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_question.js` ----- @@ -106,14 +106,14 @@ __Usage:__ ### Question_service.get_user_feedback -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_user_feedback.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_user_feedback.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1alpha/question_service.get_user_feedback.js` +`node packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.get_user_feedback.js` ----- @@ -123,14 +123,14 @@ __Usage:__ ### Question_service.update_user_feedback -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1alpha/question_service.update_user_feedback.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1alpha/question_service.update_user_feedback.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1alpha/question_service.update_user_feedback.js` +`node packages/google-cloud-dataqna/samples/generated/v1alpha/question_service.update_user_feedback.js` ----- @@ -140,14 +140,14 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/quickstart.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/quickstart.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/quickstart.js` +`node packages/google-cloud-dataqna/samples/quickstart.js` ----- @@ -157,14 +157,14 @@ __Usage:__ ### Quickstart.test -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.test.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataqna/samples/test/quickstart.test.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.test.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataqna/samples/test/quickstart.test.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/test/quickstart.test.js` +`node packages/google-cloud-dataqna/samples/test/quickstart.test.js` diff --git a/release-please-config.json b/release-please-config.json index 5cf15009311..a379081dc01 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -50,4 +50,4 @@ } ], "release-type": "node" -} +} \ No newline at end of file From f35f6831b6057cc8966d9087bc9be1ef198a1b94 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Fri, 11 Nov 2022 16:45:10 -0800 Subject: [PATCH 77/77] samples: remove env variables --- packages/google-cloud-dataqna/samples/package.json | 2 +- .../samples/test/quickstart.test.js | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-dataqna/samples/package.json b/packages/google-cloud-dataqna/samples/package.json index 7006b9de226..13aab1b6a54 100644 --- a/packages/google-cloud-dataqna/samples/package.json +++ b/packages/google-cloud-dataqna/samples/package.json @@ -20,4 +20,4 @@ "chai": "^4.2.0", "mocha": "^8.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-dataqna/samples/test/quickstart.test.js b/packages/google-cloud-dataqna/samples/test/quickstart.test.js index 6e6823f7638..211a4ec81e9 100644 --- a/packages/google-cloud-dataqna/samples/test/quickstart.test.js +++ b/packages/google-cloud-dataqna/samples/test/quickstart.test.js @@ -20,15 +20,18 @@ const {assert} = require('chai'); const cp = require('child_process'); -const {describe, it} = require('mocha'); - +const {describe, it, before} = require('mocha'); +const {AutoSuggestionServiceClient} = require('@google-cloud/data-qna'); +const client = new AutoSuggestionServiceClient(); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -const project = process.env.GCLOUD_PROJECT; - describe('Quickstart', () => { + let projectId; + before(async () => { + projectId = await client.getProjectId(); + }); it('should run quickstart', async () => { const stdout = execSync('node ./quickstart.js'); - assert.include(stdout, `Project: ${project}`); + assert.include(stdout, `Project: ${projectId}`); }); });