From 9af8e16f87c11626fd1e2ccef07ace3028c342b4 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Sat, 15 May 2021 00:04:50 +0000 Subject: [PATCH 01/69] initial generation of template files --- .../.eslintignore | 6 + .../.eslintrc.json | 3 + .../.gitattributes | 4 + .../.github/.OwlBot.yaml | 22 ++ .../google-cloud-essentialcontacts/.gitignore | 14 ++ .../google-cloud-essentialcontacts/.jsdoc.js | 55 +++++ .../.mocharc.js | 29 +++ .../google-cloud-essentialcontacts/.nycrc | 24 +++ .../.prettierignore | 6 + .../.prettierrc.js | 17 ++ .../.repo-metadata.json | 14 ++ .../CODE_OF_CONDUCT.md | 94 ++++++++ .../CONTRIBUTING.md | 76 +++++++ .../google-cloud-essentialcontacts/LICENSE | 202 ++++++++++++++++++ .../google-cloud-essentialcontacts/README.md | 125 +++++++++++ .../package.json | 64 ++++++ .../webpack.config.js | 64 ++++++ 17 files changed, 819 insertions(+) create mode 100644 packages/google-cloud-essentialcontacts/.eslintignore create mode 100644 packages/google-cloud-essentialcontacts/.eslintrc.json create mode 100644 packages/google-cloud-essentialcontacts/.gitattributes create mode 100644 packages/google-cloud-essentialcontacts/.github/.OwlBot.yaml create mode 100644 packages/google-cloud-essentialcontacts/.gitignore create mode 100644 packages/google-cloud-essentialcontacts/.jsdoc.js create mode 100644 packages/google-cloud-essentialcontacts/.mocharc.js create mode 100644 packages/google-cloud-essentialcontacts/.nycrc create mode 100644 packages/google-cloud-essentialcontacts/.prettierignore create mode 100644 packages/google-cloud-essentialcontacts/.prettierrc.js create mode 100644 packages/google-cloud-essentialcontacts/.repo-metadata.json create mode 100644 packages/google-cloud-essentialcontacts/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-essentialcontacts/CONTRIBUTING.md create mode 100644 packages/google-cloud-essentialcontacts/LICENSE create mode 100644 packages/google-cloud-essentialcontacts/README.md create mode 100644 packages/google-cloud-essentialcontacts/package.json create mode 100644 packages/google-cloud-essentialcontacts/webpack.config.js diff --git a/packages/google-cloud-essentialcontacts/.eslintignore b/packages/google-cloud-essentialcontacts/.eslintignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.eslintignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-essentialcontacts/.eslintrc.json b/packages/google-cloud-essentialcontacts/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-essentialcontacts/.gitattributes b/packages/google-cloud-essentialcontacts/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.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-essentialcontacts/.github/.OwlBot.yaml b/packages/google-cloud-essentialcontacts/.github/.OwlBot.yaml new file mode 100644 index 00000000000..a51ada55a10 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.github/.OwlBot.yaml @@ -0,0 +1,22 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/essentialcontacts/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 diff --git a/packages/google-cloud-essentialcontacts/.gitignore b/packages/google-cloud-essentialcontacts/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.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-essentialcontacts/.jsdoc.js b/packages/google-cloud-essentialcontacts/.jsdoc.js new file mode 100644 index 00000000000..7c3639c1bd8 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2021 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/essentialcontacts', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-essentialcontacts/.mocharc.js b/packages/google-cloud-essentialcontacts/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.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-essentialcontacts/.nycrc b/packages/google-cloud-essentialcontacts/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.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-essentialcontacts/.prettierignore b/packages/google-cloud-essentialcontacts/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-essentialcontacts/.prettierrc.js b/packages/google-cloud-essentialcontacts/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.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-essentialcontacts/.repo-metadata.json b/packages/google-cloud-essentialcontacts/.repo-metadata.json new file mode 100644 index 00000000000..47333d9bc8c --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "client_documentation": "https://cloud.google.com/resource-manager/docs/reference/essentialcontacts/rest", + "product_documentation": "https://cloud.google.com/resource-manager/docs/managing-notification-contacts/", + "name": "essentialcontacts", + "requires_billing": true, + "release_level": "beta", + "language": "nodejs", + "api_id": "essentialcontacts.googleapis.com", + "distribution_name": "@google-cloud/essential-contacts", + "repo": "googleapis/nodejs-essential-contacts", + "issue_tracker": "https://github.com/googleapis/nodejs-essential-contacts/issues", + "name_pretty": "Essential Contacts API", + "default_version": "v1" +} diff --git a/packages/google-cloud-essentialcontacts/CODE_OF_CONDUCT.md b/packages/google-cloud-essentialcontacts/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/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-essentialcontacts/CONTRIBUTING.md b/packages/google-cloud-essentialcontacts/CONTRIBUTING.md new file mode 100644 index 00000000000..10345763347 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Essential Contacts API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=essentialcontacts.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-essentialcontacts/LICENSE b/packages/google-cloud-essentialcontacts/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/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-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md new file mode 100644 index 00000000000..7030a9d1779 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/README.md @@ -0,0 +1,125 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Essential Contacts API: Node.js Client](https://github.com/googleapis/nodejs-essential-contacts) + +[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/essentialcontacts.svg)](https://www.npmjs.org/package/@google-cloud/essentialcontacts) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-essential-contacts/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-essential-contacts) + + + + +Essentialcontacts client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-essential-contacts/blob/master/CHANGELOG.md). + +* [Essential Contacts API Node.js Client API Reference][client-docs] +* [Essential Contacts API Documentation][product-docs] +* [github.com/googleapis/nodejs-essential-contacts](https://github.com/googleapis/nodejs-essential-contacts) + +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 Essential Contacts API 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/essentialcontacts +``` + + + + + +The [Essential Contacts API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be in **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-essential-contacts/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-essential-contacts/blob/master/LICENSE) + +[client-docs]: https://cloud.google.com/resource-manager/docs/reference/essentialcontacts/rest +[product-docs]: https://cloud.google.com/resource-manager/docs/managing-notification-contacts/ +[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=essentialcontacts.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json new file mode 100644 index 00000000000..03f6b18114a --- /dev/null +++ b/packages/google-cloud-essentialcontacts/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/essentialcontacts", + "version": "0.1.0", + "description": "Essentialcontacts client for Node.js", + "repository": "googleapis/nodejs-essentialcontacts", + "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 essentialcontacts", + "essentialcontacts", + "essential contacts service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.12.0" + }, + "devDependencies": { + "@types/mocha": "^8.2.2", + "@types/node": "^14.14.44", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.6", + "linkinator": "^2.13.6", + "mocha": "^8.4.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^10.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.2.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/packages/google-cloud-essentialcontacts/webpack.config.js b/packages/google-cloud-essentialcontacts/webpack.config.js new file mode 100644 index 00000000000..08ee1d0c0a4 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'EssentialContactsService', + filename: './essential-contacts-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 72616a62c0f6422599c38c737733b028ee31600e Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Sat, 15 May 2021 00:06:12 +0000 Subject: [PATCH 02/69] remove extraneous files --- .../.eslintignore | 6 -- .../.eslintrc.json | 3 - .../.prettierignore | 6 -- .../.prettierrc.js | 17 ----- .../webpack.config.js | 64 ------------------- 5 files changed, 96 deletions(-) delete mode 100644 packages/google-cloud-essentialcontacts/.eslintignore delete mode 100644 packages/google-cloud-essentialcontacts/.eslintrc.json delete mode 100644 packages/google-cloud-essentialcontacts/.prettierignore delete mode 100644 packages/google-cloud-essentialcontacts/.prettierrc.js delete mode 100644 packages/google-cloud-essentialcontacts/webpack.config.js diff --git a/packages/google-cloud-essentialcontacts/.eslintignore b/packages/google-cloud-essentialcontacts/.eslintignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/packages/google-cloud-essentialcontacts/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/packages/google-cloud-essentialcontacts/.eslintrc.json b/packages/google-cloud-essentialcontacts/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/packages/google-cloud-essentialcontacts/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/packages/google-cloud-essentialcontacts/.prettierignore b/packages/google-cloud-essentialcontacts/.prettierignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/packages/google-cloud-essentialcontacts/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/packages/google-cloud-essentialcontacts/.prettierrc.js b/packages/google-cloud-essentialcontacts/.prettierrc.js deleted file mode 100644 index d1b95106f4c..00000000000 --- a/packages/google-cloud-essentialcontacts/.prettierrc.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/packages/google-cloud-essentialcontacts/webpack.config.js b/packages/google-cloud-essentialcontacts/webpack.config.js deleted file mode 100644 index 08ee1d0c0a4..00000000000 --- a/packages/google-cloud-essentialcontacts/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'EssentialContactsService', - filename: './essential-contacts-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 f9210a703d5254c2462f2741a7cc9dbbddd4f330 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Sat, 15 May 2021 00:07:16 +0000 Subject: [PATCH 03/69] remove extraneous files --- .../google-cloud-essentialcontacts/.jsdoc.js | 55 ------------------- .../google-cloud-essentialcontacts/.nycrc | 24 -------- 2 files changed, 79 deletions(-) delete mode 100644 packages/google-cloud-essentialcontacts/.jsdoc.js delete mode 100644 packages/google-cloud-essentialcontacts/.nycrc diff --git a/packages/google-cloud-essentialcontacts/.jsdoc.js b/packages/google-cloud-essentialcontacts/.jsdoc.js deleted file mode 100644 index 7c3639c1bd8..00000000000 --- a/packages/google-cloud-essentialcontacts/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2021 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/essentialcontacts', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/packages/google-cloud-essentialcontacts/.nycrc b/packages/google-cloud-essentialcontacts/.nycrc deleted file mode 100644 index b18d5472b62..00000000000 --- a/packages/google-cloud-essentialcontacts/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "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 -} From 8d55c2f437547a86619f666f988b8e2ca7399caf Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Tue, 1 Jun 2021 19:00:13 -0400 Subject: [PATCH 04/69] feat: initial generation of tests and samples (#2) * feat: initial generaton of tests and samples Co-authored-by: Owl Bot --- .../.eslintignore | 6 + .../.eslintrc.json | 3 + .../google-cloud-essentialcontacts/.jsdoc.js | 55 + .../google-cloud-essentialcontacts/.nycrc | 24 + .../.prettierignore | 6 + .../.prettierrc.js | 17 + .../google-cloud-essentialcontacts/README.md | 45 +- .../api-extractor.json | 369 + .../linkinator.config.json | 13 + .../package.json | 8 +- .../cloud/essentialcontacts/v1/enums.proto | 80 + .../cloud/essentialcontacts/v1/service.proto | 343 + .../protos/protos.d.ts | 5210 ++++++ .../protos/protos.js | 13771 ++++++++++++++++ .../protos/protos.json | 1588 ++ .../samples/README.md | 50 + .../samples/package.json | 23 + .../samples/quickstart.js | 48 + .../src/index.ts | 27 + .../v1/essential_contacts_service_client.ts | 1440 ++ ...ential_contacts_service_client_config.json | 73 + ...essential_contacts_service_proto_list.json | 4 + .../src/v1/gapic_metadata.json | 101 + .../src/v1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 34 + .../system-test/install.ts | 51 + .../gapic_essential_contacts_service_v1.ts | 1618 ++ .../tsconfig.json | 19 + .../webpack.config.js | 64 + 30 files changed, 25128 insertions(+), 8 deletions(-) create mode 100644 packages/google-cloud-essentialcontacts/.eslintignore create mode 100644 packages/google-cloud-essentialcontacts/.eslintrc.json create mode 100644 packages/google-cloud-essentialcontacts/.jsdoc.js create mode 100644 packages/google-cloud-essentialcontacts/.nycrc create mode 100644 packages/google-cloud-essentialcontacts/.prettierignore create mode 100644 packages/google-cloud-essentialcontacts/.prettierrc.js create mode 100644 packages/google-cloud-essentialcontacts/api-extractor.json create mode 100644 packages/google-cloud-essentialcontacts/linkinator.config.json create mode 100644 packages/google-cloud-essentialcontacts/protos/google/cloud/essentialcontacts/v1/enums.proto create mode 100644 packages/google-cloud-essentialcontacts/protos/google/cloud/essentialcontacts/v1/service.proto create mode 100644 packages/google-cloud-essentialcontacts/protos/protos.d.ts create mode 100644 packages/google-cloud-essentialcontacts/protos/protos.js create mode 100644 packages/google-cloud-essentialcontacts/protos/protos.json create mode 100644 packages/google-cloud-essentialcontacts/samples/README.md create mode 100644 packages/google-cloud-essentialcontacts/samples/package.json create mode 100644 packages/google-cloud-essentialcontacts/samples/quickstart.js create mode 100644 packages/google-cloud-essentialcontacts/src/index.ts create mode 100644 packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts create mode 100644 packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client_config.json create mode 100644 packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_proto_list.json create mode 100644 packages/google-cloud-essentialcontacts/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-essentialcontacts/src/v1/index.ts create mode 100644 packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-essentialcontacts/system-test/install.ts create mode 100644 packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts create mode 100644 packages/google-cloud-essentialcontacts/tsconfig.json create mode 100644 packages/google-cloud-essentialcontacts/webpack.config.js diff --git a/packages/google-cloud-essentialcontacts/.eslintignore b/packages/google-cloud-essentialcontacts/.eslintignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.eslintignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-essentialcontacts/.eslintrc.json b/packages/google-cloud-essentialcontacts/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-essentialcontacts/.jsdoc.js b/packages/google-cloud-essentialcontacts/.jsdoc.js new file mode 100644 index 00000000000..6f68d46118c --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2021 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/essential-contacts', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; \ No newline at end of file diff --git a/packages/google-cloud-essentialcontacts/.nycrc b/packages/google-cloud-essentialcontacts/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.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-essentialcontacts/.prettierignore b/packages/google-cloud-essentialcontacts/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-essentialcontacts/.prettierrc.js b/packages/google-cloud-essentialcontacts/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-essentialcontacts/.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-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index 7030a9d1779..36c3efaaa5e 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -5,13 +5,13 @@ # [Essential Contacts API: Node.js Client](https://github.com/googleapis/nodejs-essential-contacts) [![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![npm version](https://img.shields.io/npm/v/@google-cloud/essentialcontacts.svg)](https://www.npmjs.org/package/@google-cloud/essentialcontacts) +[![npm version](https://img.shields.io/npm/v/@google-cloud/essential-contacts.svg)](https://www.npmjs.org/package/@google-cloud/essential-contacts) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-essential-contacts/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-essential-contacts) -Essentialcontacts client for Node.js +Essential contacts client for Node.js A comprehensive list of changes in each version may be found in @@ -32,8 +32,8 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. * [Quickstart](#quickstart) * [Before you begin](#before-you-begin) * [Installing the client library](#installing-the-client-library) - - + * [Using the client library](#using-the-client-library) +* [Samples](#samples) * [Versioning](#versioning) * [Contributing](#contributing) * [License](#license) @@ -51,11 +51,46 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. ### Installing the client library ```bash -npm install @google-cloud/essentialcontacts +npm install @google-cloud/essential-contacts +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library + +// eslint-disable-next-line node/no-missing-require +const { + EssentialContactsServiceClient, +} = require('@google-cloud/essential-contacts'); + +// TODO(developer): replace with your prefered project ID and serviceName. +// const projectId = 'my-project' + +// Creates a client +const client = new EssentialContactsServiceClient(); + +async function listContacts() { + const [response] = await client.listContacts({ + parent: `projects/${projectId}`, + }); + console.info(response); +} +listContacts(); + ``` +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-essential-contacts/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-essential-contacts/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-essential-contacts&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + The [Essential Contacts API Node.js Client API Reference][client-docs] documentation diff --git a/packages/google-cloud-essentialcontacts/api-extractor.json b/packages/google-cloud-essentialcontacts/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/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-essentialcontacts/linkinator.config.json b/packages/google-cloud-essentialcontacts/linkinator.config.json new file mode 100644 index 00000000000..2273933dc80 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/linkinator.config.json @@ -0,0 +1,13 @@ +{ + "recurse": true, + "skip": [ + "https://github.com/googleapis/nodejs-essential-contacts/blob/master/samples/quickstart.js", + "https://github.com/googleapis/nodejs-essential-contacts/blob/master/CHANGELOG.md", + "https://github.com/googleapis/nodejs-essential-contacts/tree/master/samples", + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 03f6b18114a..bafdd47e97c 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,8 +1,8 @@ { - "name": "@google-cloud/essentialcontacts", + "name": "@google-cloud/essential-contacts", "version": "0.1.0", - "description": "Essentialcontacts client for Node.js", - "repository": "googleapis/nodejs-essentialcontacts", + "description": "Essential contacts client for Node.js", + "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", "author": "Google LLC", "main": "build/src/index.js", @@ -28,6 +28,8 @@ "compile": "tsc -p . && cp -r protos build/", "compile-protos": "compileProtos src", "docs": "jsdoc -c .jsdoc.js", + "samples-test": "cd samples/ && npm link ../ && npm test", + "prelint": "cd samples; npm link ../; npm i", "predocs-test": "npm run docs", "docs-test": "linkinator docs", "fix": "gts fix", diff --git a/packages/google-cloud-essentialcontacts/protos/google/cloud/essentialcontacts/v1/enums.proto b/packages/google-cloud-essentialcontacts/protos/google/cloud/essentialcontacts/v1/enums.proto new file mode 100644 index 00000000000..6fcdeb3735c --- /dev/null +++ b/packages/google-cloud-essentialcontacts/protos/google/cloud/essentialcontacts/v1/enums.proto @@ -0,0 +1,80 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.essentialcontacts.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/essentialcontacts/v1;essentialcontacts"; +option java_multiple_files = true; +option java_outer_classname = "EnumsProto"; +option java_package = "com.google.cloud.essentialcontacts.v1"; +option csharp_namespace = "Google.Cloud.EssentialContacts.V1"; +option php_namespace = "Google\\Cloud\\EssentialContacts\\V1"; +option ruby_package = "Google::Cloud::EssentialContacts::V1"; + +// The notification categories that an essential contact can be subscribed to. +// Each notification will be categorized by the sender into one of the following +// categories. All contacts that are subscribed to that category will receive +// the notification. +enum NotificationCategory { + // Notification category is unrecognized or unspecified. + NOTIFICATION_CATEGORY_UNSPECIFIED = 0; + + // All notifications related to the resource, including notifications + // pertaining to categories added in the future. + ALL = 2; + + // Notifications related to imminent account suspension. + SUSPENSION = 3; + + // Notifications related to security/privacy incidents, notifications, and + // vulnerabilities. + SECURITY = 5; + + // Notifications related to technical events and issues such as outages, + // errors, or bugs. + TECHNICAL = 6; + + // Notifications related to billing and payments notifications, price updates, + // errors, or credits. + BILLING = 7; + + // Notifications related to enforcement actions, regulatory compliance, or + // government notices. + LEGAL = 8; + + // Notifications related to new versions, product terms updates, or + // deprecations. + PRODUCT_UPDATES = 9; + + // Child category of TECHNICAL. If assigned, technical incident notifications + // will go to these contacts instead of TECHNICAL. + TECHNICAL_INCIDENTS = 10; +} + +// A contact's validation state indicates whether or not it is the correct +// contact to be receiving notifications for a particular resource. +enum ValidationState { + // The validation state is unknown or unspecified. + VALIDATION_STATE_UNSPECIFIED = 0; + + // The contact is marked as valid. This is usually done manually by the + // contact admin. All new contacts begin in the valid state. + VALID = 1; + + // The contact is considered invalid. This may become the state if the + // contact's email is found to be unreachable. + INVALID = 2; +} diff --git a/packages/google-cloud-essentialcontacts/protos/google/cloud/essentialcontacts/v1/service.proto b/packages/google-cloud-essentialcontacts/protos/google/cloud/essentialcontacts/v1/service.proto new file mode 100644 index 00000000000..2bd0f1a6163 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/protos/google/cloud/essentialcontacts/v1/service.proto @@ -0,0 +1,343 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.essentialcontacts.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/essentialcontacts/v1/enums.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/essentialcontacts/v1;essentialcontacts"; +option java_multiple_files = true; +option java_package = "com.google.cloud.essentialcontacts.v1"; +option csharp_namespace = "Google.Cloud.EssentialContacts.V1"; +option php_namespace = "Google\\Cloud\\EssentialContacts\\V1"; +option ruby_package = "Google::Cloud::EssentialContacts::V1"; + +// Manages contacts for important Google Cloud notifications. +service EssentialContactsService { + option (google.api.default_host) = "essentialcontacts.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Adds a new contact for a resource. + rpc CreateContact(CreateContactRequest) returns (Contact) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/contacts" + body: "contact" + additional_bindings { + post: "/v1/{parent=folders/*}/contacts" + body: "contact" + } + additional_bindings { + post: "/v1/{parent=organizations/*}/contacts" + body: "contact" + } + }; + option (google.api.method_signature) = "parent,contact"; + } + + // Updates a contact. + // Note: A contact's email address cannot be changed. + rpc UpdateContact(UpdateContactRequest) returns (Contact) { + option (google.api.http) = { + patch: "/v1/{contact.name=projects/*/contacts/*}" + body: "contact" + additional_bindings { + patch: "/v1/{contact.name=folders/*/contacts/*}" + body: "contact" + } + additional_bindings { + patch: "/v1/{contact.name=organizations/*/contacts/*}" + body: "contact" + } + }; + option (google.api.method_signature) = "contact,update_mask"; + } + + // Lists the contacts that have been set on a resource. + rpc ListContacts(ListContactsRequest) returns (ListContactsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/contacts" + additional_bindings { get: "/v1/{parent=folders/*}/contacts" } + additional_bindings { get: "/v1/{parent=organizations/*}/contacts" } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a single contact. + rpc GetContact(GetContactRequest) returns (Contact) { + option (google.api.http) = { + get: "/v1/{name=projects/*/contacts/*}" + additional_bindings { get: "/v1/{name=folders/*/contacts/*}" } + additional_bindings { get: "/v1/{name=organizations/*/contacts/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a contact. + rpc DeleteContact(DeleteContactRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/contacts/*}" + additional_bindings { delete: "/v1/{name=folders/*/contacts/*}" } + additional_bindings { delete: "/v1/{name=organizations/*/contacts/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Lists all contacts for the resource that are subscribed to the + // specified notification categories, including contacts inherited from + // any parent resources. + rpc ComputeContacts(ComputeContactsRequest) + returns (ComputeContactsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/contacts:compute" + additional_bindings { get: "/v1/{parent=folders/*}/contacts:compute" } + additional_bindings { + get: "/v1/{parent=organizations/*}/contacts:compute" + } + }; + } + + // Allows a contact admin to send a test message to contact to verify that it + // has been configured correctly. + rpc SendTestMessage(SendTestMessageRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{resource=projects/*}/contacts:sendTestMessage" + body: "*" + additional_bindings { + post: "/v1/{resource=folders/*}/contacts:sendTestMessage" + body: "*" + } + additional_bindings { + post: "/v1/{resource=organizations/*}/contacts:sendTestMessage" + body: "*" + } + }; + } +} + +// A contact that will receive notifications from Google Cloud. +message Contact { + option (google.api.resource) = { + type: "essentialcontacts.googleapis.com/Contact" + pattern: "projects/{project}/contacts/{contact}" + pattern: "folders/{folder}/contacts/{contact}" + pattern: "organizations/{organization}/contacts/{contact}" + }; + + // The identifier for the contact. + // Format: {resource_type}/{resource_id}/contacts/{contact_id} + string name = 1; + + // Required. The email address to send notifications to. This does not need to + // be a Google account. + string email = 2; + + // The categories of notifications that the contact will receive + // communications for. + repeated NotificationCategory notification_category_subscriptions = 3; + + // The preferred language for notifications, as a ISO 639-1 language code. See + // [Supported + // languages](https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages) + // for a list of supported languages. + string language_tag = 4; + + // The validity of the contact. A contact is considered valid if it is the + // correct recipient for notifications for a particular resource. + ValidationState validation_state = 8; + + // The last time the validation_state was updated, either manually or + // automatically. A contact is considered stale if its validation state was + // updated more than 1 year ago. + google.protobuf.Timestamp validate_time = 9; +} + +// Request message for the ListContacts method. +message ListContactsRequest { + // Required. The parent resource name. + // Format: organizations/{organization_id}, folders/{folder_id} or + // projects/{project_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "essentialcontacts.googleapis.com/Contact" + } + ]; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `next_page_token` in the + // response indicates that more results might be available. + // If not specified, the default page_size is 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, retrieves the next batch of results from the + // preceding call to this method. `page_token` must be the value of + // `next_page_token` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the ListContacts method. +message ListContactsResponse { + // The contacts for the specified resource. + repeated Contact contacts = 1; + + // If there are more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token` and the + // rest of the parameters the same as the original request. + string next_page_token = 2; +} + +// Request message for the GetContact method. +message GetContactRequest { + // Required. The name of the contact to retrieve. + // Format: organizations/{organization_id}/contacts/{contact_id}, + // folders/{folder_id}/contacts/{contact_id} or + // projects/{project_id}/contacts/{contact_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "essentialcontacts.googleapis.com/Contact" + } + ]; +} + +// Request message for the DeleteContact method. +message DeleteContactRequest { + // Required. The name of the contact to delete. + // Format: organizations/{organization_id}/contacts/{contact_id}, + // folders/{folder_id}/contacts/{contact_id} or + // projects/{project_id}/contacts/{contact_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "essentialcontacts.googleapis.com/Contact" + } + ]; +} + +// Request message for the CreateContact method. +message CreateContactRequest { + // Required. The resource to save this contact for. + // Format: organizations/{organization_id}, folders/{folder_id} or + // projects/{project_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "essentialcontacts.googleapis.com/Contact" + } + ]; + + // Required. The contact to create. Must specify an email address and language + // tag. + Contact contact = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the UpdateContact method. +message UpdateContactRequest { + // Required. The contact resource to replace the existing saved contact. Note: + // the email address of the contact cannot be modified. + Contact contact = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The update mask applied to the resource. For the `FieldMask` + // definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the ComputeContacts method. +message ComputeContactsRequest { + // Required. The name of the resource to compute contacts for. + // Format: organizations/{organization_id}, + // folders/{folder_id} or projects/{project_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "essentialcontacts.googleapis.com/Contact" + } + ]; + + // The categories of notifications to compute contacts for. If ALL is included + // in this list, contacts subscribed to any notification category will be + // returned. + repeated NotificationCategory notification_categories = 6; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `next_page_token` in the + // response indicates that more results might be available. + // If not specified, the default page_size is 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, retrieves the next batch of results from the + // preceding call to this method. `page_token` must be the value of + // `next_page_token` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the ComputeContacts method. +message ComputeContactsResponse { + // All contacts for the resource that are subscribed to the specified + // notification categories, including contacts inherited from any parent + // resources. + repeated Contact contacts = 1; + + // If there are more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token` and the + // rest of the parameters the same as the original request. + string next_page_token = 2; +} + +// Request message for the SendTestMessage method. +message SendTestMessageRequest { + // Required. The list of names of the contacts to send a test message to. + // Format: organizations/{organization_id}/contacts/{contact_id}, + // folders/{folder_id}/contacts/{contact_id} or + // projects/{project_id}/contacts/{contact_id} + repeated string contacts = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "essentialcontacts.googleapis.com/Contact" + } + ]; + + // Required. The name of the resource to send the test message for. All + // contacts must either be set directly on this resource or inherited from + // another resource that is an ancestor of this one. Format: + // organizations/{organization_id}, folders/{folder_id} or + // projects/{project_id} + string resource = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "essentialcontacts.googleapis.com/Contact" + } + ]; + + // Required. The notification category to send the test message for. All + // contacts must be subscribed to this category. + NotificationCategory notification_category = 3 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-essentialcontacts/protos/protos.d.ts b/packages/google-cloud-essentialcontacts/protos/protos.d.ts new file mode 100644 index 00000000000..eb580418630 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/protos/protos.d.ts @@ -0,0 +1,5210 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as Long from "long"; +import {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace essentialcontacts. */ + namespace essentialcontacts { + + /** Namespace v1. */ + namespace v1 { + + /** NotificationCategory enum. */ + enum NotificationCategory { + NOTIFICATION_CATEGORY_UNSPECIFIED = 0, + ALL = 2, + SUSPENSION = 3, + SECURITY = 5, + TECHNICAL = 6, + BILLING = 7, + LEGAL = 8, + PRODUCT_UPDATES = 9, + TECHNICAL_INCIDENTS = 10 + } + + /** ValidationState enum. */ + enum ValidationState { + VALIDATION_STATE_UNSPECIFIED = 0, + VALID = 1, + INVALID = 2 + } + + /** Represents an EssentialContactsService */ + class EssentialContactsService extends $protobuf.rpc.Service { + + /** + * Constructs a new EssentialContactsService 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 EssentialContactsService 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): EssentialContactsService; + + /** + * Calls CreateContact. + * @param request CreateContactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Contact + */ + public createContact(request: google.cloud.essentialcontacts.v1.ICreateContactRequest, callback: google.cloud.essentialcontacts.v1.EssentialContactsService.CreateContactCallback): void; + + /** + * Calls CreateContact. + * @param request CreateContactRequest message or plain object + * @returns Promise + */ + public createContact(request: google.cloud.essentialcontacts.v1.ICreateContactRequest): Promise; + + /** + * Calls UpdateContact. + * @param request UpdateContactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Contact + */ + public updateContact(request: google.cloud.essentialcontacts.v1.IUpdateContactRequest, callback: google.cloud.essentialcontacts.v1.EssentialContactsService.UpdateContactCallback): void; + + /** + * Calls UpdateContact. + * @param request UpdateContactRequest message or plain object + * @returns Promise + */ + public updateContact(request: google.cloud.essentialcontacts.v1.IUpdateContactRequest): Promise; + + /** + * Calls ListContacts. + * @param request ListContactsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListContactsResponse + */ + public listContacts(request: google.cloud.essentialcontacts.v1.IListContactsRequest, callback: google.cloud.essentialcontacts.v1.EssentialContactsService.ListContactsCallback): void; + + /** + * Calls ListContacts. + * @param request ListContactsRequest message or plain object + * @returns Promise + */ + public listContacts(request: google.cloud.essentialcontacts.v1.IListContactsRequest): Promise; + + /** + * Calls GetContact. + * @param request GetContactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Contact + */ + public getContact(request: google.cloud.essentialcontacts.v1.IGetContactRequest, callback: google.cloud.essentialcontacts.v1.EssentialContactsService.GetContactCallback): void; + + /** + * Calls GetContact. + * @param request GetContactRequest message or plain object + * @returns Promise + */ + public getContact(request: google.cloud.essentialcontacts.v1.IGetContactRequest): Promise; + + /** + * Calls DeleteContact. + * @param request DeleteContactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteContact(request: google.cloud.essentialcontacts.v1.IDeleteContactRequest, callback: google.cloud.essentialcontacts.v1.EssentialContactsService.DeleteContactCallback): void; + + /** + * Calls DeleteContact. + * @param request DeleteContactRequest message or plain object + * @returns Promise + */ + public deleteContact(request: google.cloud.essentialcontacts.v1.IDeleteContactRequest): Promise; + + /** + * Calls ComputeContacts. + * @param request ComputeContactsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ComputeContactsResponse + */ + public computeContacts(request: google.cloud.essentialcontacts.v1.IComputeContactsRequest, callback: google.cloud.essentialcontacts.v1.EssentialContactsService.ComputeContactsCallback): void; + + /** + * Calls ComputeContacts. + * @param request ComputeContactsRequest message or plain object + * @returns Promise + */ + public computeContacts(request: google.cloud.essentialcontacts.v1.IComputeContactsRequest): Promise; + + /** + * Calls SendTestMessage. + * @param request SendTestMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public sendTestMessage(request: google.cloud.essentialcontacts.v1.ISendTestMessageRequest, callback: google.cloud.essentialcontacts.v1.EssentialContactsService.SendTestMessageCallback): void; + + /** + * Calls SendTestMessage. + * @param request SendTestMessageRequest message or plain object + * @returns Promise + */ + public sendTestMessage(request: google.cloud.essentialcontacts.v1.ISendTestMessageRequest): Promise; + } + + namespace EssentialContactsService { + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#createContact}. + * @param error Error, if any + * @param [response] Contact + */ + type CreateContactCallback = (error: (Error|null), response?: google.cloud.essentialcontacts.v1.Contact) => void; + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#updateContact}. + * @param error Error, if any + * @param [response] Contact + */ + type UpdateContactCallback = (error: (Error|null), response?: google.cloud.essentialcontacts.v1.Contact) => void; + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#listContacts}. + * @param error Error, if any + * @param [response] ListContactsResponse + */ + type ListContactsCallback = (error: (Error|null), response?: google.cloud.essentialcontacts.v1.ListContactsResponse) => void; + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#getContact}. + * @param error Error, if any + * @param [response] Contact + */ + type GetContactCallback = (error: (Error|null), response?: google.cloud.essentialcontacts.v1.Contact) => void; + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#deleteContact}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteContactCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#computeContacts}. + * @param error Error, if any + * @param [response] ComputeContactsResponse + */ + type ComputeContactsCallback = (error: (Error|null), response?: google.cloud.essentialcontacts.v1.ComputeContactsResponse) => void; + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#sendTestMessage}. + * @param error Error, if any + * @param [response] Empty + */ + type SendTestMessageCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a Contact. */ + interface IContact { + + /** Contact name */ + name?: (string|null); + + /** Contact email */ + email?: (string|null); + + /** Contact notificationCategorySubscriptions */ + notificationCategorySubscriptions?: (google.cloud.essentialcontacts.v1.NotificationCategory[]|null); + + /** Contact languageTag */ + languageTag?: (string|null); + + /** Contact validationState */ + validationState?: (google.cloud.essentialcontacts.v1.ValidationState|keyof typeof google.cloud.essentialcontacts.v1.ValidationState|null); + + /** Contact validateTime */ + validateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Contact. */ + class Contact implements IContact { + + /** + * Constructs a new Contact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.essentialcontacts.v1.IContact); + + /** Contact name. */ + public name: string; + + /** Contact email. */ + public email: string; + + /** Contact notificationCategorySubscriptions. */ + public notificationCategorySubscriptions: google.cloud.essentialcontacts.v1.NotificationCategory[]; + + /** Contact languageTag. */ + public languageTag: string; + + /** Contact validationState. */ + public validationState: (google.cloud.essentialcontacts.v1.ValidationState|keyof typeof google.cloud.essentialcontacts.v1.ValidationState); + + /** Contact validateTime. */ + public validateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Contact instance using the specified properties. + * @param [properties] Properties to set + * @returns Contact instance + */ + public static create(properties?: google.cloud.essentialcontacts.v1.IContact): google.cloud.essentialcontacts.v1.Contact; + + /** + * Encodes the specified Contact message. Does not implicitly {@link google.cloud.essentialcontacts.v1.Contact.verify|verify} messages. + * @param message Contact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.essentialcontacts.v1.IContact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Contact message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.Contact.verify|verify} messages. + * @param message Contact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.essentialcontacts.v1.IContact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Contact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Contact + * @throws {Error} If the payload is not 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.essentialcontacts.v1.Contact; + + /** + * Decodes a Contact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Contact + * @throws {Error} If the payload 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.essentialcontacts.v1.Contact; + + /** + * Verifies a Contact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Contact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Contact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.essentialcontacts.v1.Contact; + + /** + * Creates a plain object from a Contact message. Also converts values to other types if specified. + * @param message Contact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.essentialcontacts.v1.Contact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Contact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListContactsRequest. */ + interface IListContactsRequest { + + /** ListContactsRequest parent */ + parent?: (string|null); + + /** ListContactsRequest pageSize */ + pageSize?: (number|null); + + /** ListContactsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListContactsRequest. */ + class ListContactsRequest implements IListContactsRequest { + + /** + * Constructs a new ListContactsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.essentialcontacts.v1.IListContactsRequest); + + /** ListContactsRequest parent. */ + public parent: string; + + /** ListContactsRequest pageSize. */ + public pageSize: number; + + /** ListContactsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListContactsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContactsRequest instance + */ + public static create(properties?: google.cloud.essentialcontacts.v1.IListContactsRequest): google.cloud.essentialcontacts.v1.ListContactsRequest; + + /** + * Encodes the specified ListContactsRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.ListContactsRequest.verify|verify} messages. + * @param message ListContactsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.essentialcontacts.v1.IListContactsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContactsRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.ListContactsRequest.verify|verify} messages. + * @param message ListContactsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.essentialcontacts.v1.IListContactsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContactsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContactsRequest + * @throws {Error} If the payload is not 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.essentialcontacts.v1.ListContactsRequest; + + /** + * Decodes a ListContactsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContactsRequest + * @throws {Error} If the payload 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.essentialcontacts.v1.ListContactsRequest; + + /** + * Verifies a ListContactsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListContactsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContactsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.essentialcontacts.v1.ListContactsRequest; + + /** + * Creates a plain object from a ListContactsRequest message. Also converts values to other types if specified. + * @param message ListContactsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.essentialcontacts.v1.ListContactsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContactsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListContactsResponse. */ + interface IListContactsResponse { + + /** ListContactsResponse contacts */ + contacts?: (google.cloud.essentialcontacts.v1.IContact[]|null); + + /** ListContactsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListContactsResponse. */ + class ListContactsResponse implements IListContactsResponse { + + /** + * Constructs a new ListContactsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.essentialcontacts.v1.IListContactsResponse); + + /** ListContactsResponse contacts. */ + public contacts: google.cloud.essentialcontacts.v1.IContact[]; + + /** ListContactsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListContactsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContactsResponse instance + */ + public static create(properties?: google.cloud.essentialcontacts.v1.IListContactsResponse): google.cloud.essentialcontacts.v1.ListContactsResponse; + + /** + * Encodes the specified ListContactsResponse message. Does not implicitly {@link google.cloud.essentialcontacts.v1.ListContactsResponse.verify|verify} messages. + * @param message ListContactsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.essentialcontacts.v1.IListContactsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContactsResponse message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.ListContactsResponse.verify|verify} messages. + * @param message ListContactsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.essentialcontacts.v1.IListContactsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContactsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContactsResponse + * @throws {Error} If the payload is not 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.essentialcontacts.v1.ListContactsResponse; + + /** + * Decodes a ListContactsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContactsResponse + * @throws {Error} If the payload 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.essentialcontacts.v1.ListContactsResponse; + + /** + * Verifies a ListContactsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListContactsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContactsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.essentialcontacts.v1.ListContactsResponse; + + /** + * Creates a plain object from a ListContactsResponse message. Also converts values to other types if specified. + * @param message ListContactsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.essentialcontacts.v1.ListContactsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContactsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetContactRequest. */ + interface IGetContactRequest { + + /** GetContactRequest name */ + name?: (string|null); + } + + /** Represents a GetContactRequest. */ + class GetContactRequest implements IGetContactRequest { + + /** + * Constructs a new GetContactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.essentialcontacts.v1.IGetContactRequest); + + /** GetContactRequest name. */ + public name: string; + + /** + * Creates a new GetContactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetContactRequest instance + */ + public static create(properties?: google.cloud.essentialcontacts.v1.IGetContactRequest): google.cloud.essentialcontacts.v1.GetContactRequest; + + /** + * Encodes the specified GetContactRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.GetContactRequest.verify|verify} messages. + * @param message GetContactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.essentialcontacts.v1.IGetContactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetContactRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.GetContactRequest.verify|verify} messages. + * @param message GetContactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.essentialcontacts.v1.IGetContactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetContactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetContactRequest + * @throws {Error} If the payload is not 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.essentialcontacts.v1.GetContactRequest; + + /** + * Decodes a GetContactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetContactRequest + * @throws {Error} If the payload 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.essentialcontacts.v1.GetContactRequest; + + /** + * Verifies a GetContactRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetContactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetContactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.essentialcontacts.v1.GetContactRequest; + + /** + * Creates a plain object from a GetContactRequest message. Also converts values to other types if specified. + * @param message GetContactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.essentialcontacts.v1.GetContactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetContactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteContactRequest. */ + interface IDeleteContactRequest { + + /** DeleteContactRequest name */ + name?: (string|null); + } + + /** Represents a DeleteContactRequest. */ + class DeleteContactRequest implements IDeleteContactRequest { + + /** + * Constructs a new DeleteContactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.essentialcontacts.v1.IDeleteContactRequest); + + /** DeleteContactRequest name. */ + public name: string; + + /** + * Creates a new DeleteContactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteContactRequest instance + */ + public static create(properties?: google.cloud.essentialcontacts.v1.IDeleteContactRequest): google.cloud.essentialcontacts.v1.DeleteContactRequest; + + /** + * Encodes the specified DeleteContactRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.DeleteContactRequest.verify|verify} messages. + * @param message DeleteContactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.essentialcontacts.v1.IDeleteContactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteContactRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.DeleteContactRequest.verify|verify} messages. + * @param message DeleteContactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.essentialcontacts.v1.IDeleteContactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteContactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteContactRequest + * @throws {Error} If the payload is not 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.essentialcontacts.v1.DeleteContactRequest; + + /** + * Decodes a DeleteContactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteContactRequest + * @throws {Error} If the payload 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.essentialcontacts.v1.DeleteContactRequest; + + /** + * Verifies a DeleteContactRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteContactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteContactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.essentialcontacts.v1.DeleteContactRequest; + + /** + * Creates a plain object from a DeleteContactRequest message. Also converts values to other types if specified. + * @param message DeleteContactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.essentialcontacts.v1.DeleteContactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteContactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateContactRequest. */ + interface ICreateContactRequest { + + /** CreateContactRequest parent */ + parent?: (string|null); + + /** CreateContactRequest contact */ + contact?: (google.cloud.essentialcontacts.v1.IContact|null); + } + + /** Represents a CreateContactRequest. */ + class CreateContactRequest implements ICreateContactRequest { + + /** + * Constructs a new CreateContactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.essentialcontacts.v1.ICreateContactRequest); + + /** CreateContactRequest parent. */ + public parent: string; + + /** CreateContactRequest contact. */ + public contact?: (google.cloud.essentialcontacts.v1.IContact|null); + + /** + * Creates a new CreateContactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateContactRequest instance + */ + public static create(properties?: google.cloud.essentialcontacts.v1.ICreateContactRequest): google.cloud.essentialcontacts.v1.CreateContactRequest; + + /** + * Encodes the specified CreateContactRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.CreateContactRequest.verify|verify} messages. + * @param message CreateContactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.essentialcontacts.v1.ICreateContactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateContactRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.CreateContactRequest.verify|verify} messages. + * @param message CreateContactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.essentialcontacts.v1.ICreateContactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateContactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateContactRequest + * @throws {Error} If the payload is not 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.essentialcontacts.v1.CreateContactRequest; + + /** + * Decodes a CreateContactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateContactRequest + * @throws {Error} If the payload 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.essentialcontacts.v1.CreateContactRequest; + + /** + * Verifies a CreateContactRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateContactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateContactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.essentialcontacts.v1.CreateContactRequest; + + /** + * Creates a plain object from a CreateContactRequest message. Also converts values to other types if specified. + * @param message CreateContactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.essentialcontacts.v1.CreateContactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateContactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateContactRequest. */ + interface IUpdateContactRequest { + + /** UpdateContactRequest contact */ + contact?: (google.cloud.essentialcontacts.v1.IContact|null); + + /** UpdateContactRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateContactRequest. */ + class UpdateContactRequest implements IUpdateContactRequest { + + /** + * Constructs a new UpdateContactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.essentialcontacts.v1.IUpdateContactRequest); + + /** UpdateContactRequest contact. */ + public contact?: (google.cloud.essentialcontacts.v1.IContact|null); + + /** UpdateContactRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateContactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateContactRequest instance + */ + public static create(properties?: google.cloud.essentialcontacts.v1.IUpdateContactRequest): google.cloud.essentialcontacts.v1.UpdateContactRequest; + + /** + * Encodes the specified UpdateContactRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.UpdateContactRequest.verify|verify} messages. + * @param message UpdateContactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.essentialcontacts.v1.IUpdateContactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateContactRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.UpdateContactRequest.verify|verify} messages. + * @param message UpdateContactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.essentialcontacts.v1.IUpdateContactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateContactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateContactRequest + * @throws {Error} If the payload is not 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.essentialcontacts.v1.UpdateContactRequest; + + /** + * Decodes an UpdateContactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateContactRequest + * @throws {Error} If the payload 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.essentialcontacts.v1.UpdateContactRequest; + + /** + * Verifies an UpdateContactRequest message. + * @param message Plain 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 UpdateContactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateContactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.essentialcontacts.v1.UpdateContactRequest; + + /** + * Creates a plain object from an UpdateContactRequest message. Also converts values to other types if specified. + * @param message UpdateContactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.essentialcontacts.v1.UpdateContactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateContactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ComputeContactsRequest. */ + interface IComputeContactsRequest { + + /** ComputeContactsRequest parent */ + parent?: (string|null); + + /** ComputeContactsRequest notificationCategories */ + notificationCategories?: (google.cloud.essentialcontacts.v1.NotificationCategory[]|null); + + /** ComputeContactsRequest pageSize */ + pageSize?: (number|null); + + /** ComputeContactsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ComputeContactsRequest. */ + class ComputeContactsRequest implements IComputeContactsRequest { + + /** + * Constructs a new ComputeContactsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.essentialcontacts.v1.IComputeContactsRequest); + + /** ComputeContactsRequest parent. */ + public parent: string; + + /** ComputeContactsRequest notificationCategories. */ + public notificationCategories: google.cloud.essentialcontacts.v1.NotificationCategory[]; + + /** ComputeContactsRequest pageSize. */ + public pageSize: number; + + /** ComputeContactsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ComputeContactsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeContactsRequest instance + */ + public static create(properties?: google.cloud.essentialcontacts.v1.IComputeContactsRequest): google.cloud.essentialcontacts.v1.ComputeContactsRequest; + + /** + * Encodes the specified ComputeContactsRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.ComputeContactsRequest.verify|verify} messages. + * @param message ComputeContactsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.essentialcontacts.v1.IComputeContactsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeContactsRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.ComputeContactsRequest.verify|verify} messages. + * @param message ComputeContactsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.essentialcontacts.v1.IComputeContactsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeContactsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeContactsRequest + * @throws {Error} If the payload is not 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.essentialcontacts.v1.ComputeContactsRequest; + + /** + * Decodes a ComputeContactsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeContactsRequest + * @throws {Error} If the payload 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.essentialcontacts.v1.ComputeContactsRequest; + + /** + * Verifies a ComputeContactsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeContactsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeContactsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.essentialcontacts.v1.ComputeContactsRequest; + + /** + * Creates a plain object from a ComputeContactsRequest message. Also converts values to other types if specified. + * @param message ComputeContactsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.essentialcontacts.v1.ComputeContactsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeContactsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ComputeContactsResponse. */ + interface IComputeContactsResponse { + + /** ComputeContactsResponse contacts */ + contacts?: (google.cloud.essentialcontacts.v1.IContact[]|null); + + /** ComputeContactsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ComputeContactsResponse. */ + class ComputeContactsResponse implements IComputeContactsResponse { + + /** + * Constructs a new ComputeContactsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.essentialcontacts.v1.IComputeContactsResponse); + + /** ComputeContactsResponse contacts. */ + public contacts: google.cloud.essentialcontacts.v1.IContact[]; + + /** ComputeContactsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ComputeContactsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeContactsResponse instance + */ + public static create(properties?: google.cloud.essentialcontacts.v1.IComputeContactsResponse): google.cloud.essentialcontacts.v1.ComputeContactsResponse; + + /** + * Encodes the specified ComputeContactsResponse message. Does not implicitly {@link google.cloud.essentialcontacts.v1.ComputeContactsResponse.verify|verify} messages. + * @param message ComputeContactsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.essentialcontacts.v1.IComputeContactsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeContactsResponse message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.ComputeContactsResponse.verify|verify} messages. + * @param message ComputeContactsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.essentialcontacts.v1.IComputeContactsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeContactsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeContactsResponse + * @throws {Error} If the payload is not 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.essentialcontacts.v1.ComputeContactsResponse; + + /** + * Decodes a ComputeContactsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeContactsResponse + * @throws {Error} If the payload 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.essentialcontacts.v1.ComputeContactsResponse; + + /** + * Verifies a ComputeContactsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeContactsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeContactsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.essentialcontacts.v1.ComputeContactsResponse; + + /** + * Creates a plain object from a ComputeContactsResponse message. Also converts values to other types if specified. + * @param message ComputeContactsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.essentialcontacts.v1.ComputeContactsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeContactsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SendTestMessageRequest. */ + interface ISendTestMessageRequest { + + /** SendTestMessageRequest contacts */ + contacts?: (string[]|null); + + /** SendTestMessageRequest resource */ + resource?: (string|null); + + /** SendTestMessageRequest notificationCategory */ + notificationCategory?: (google.cloud.essentialcontacts.v1.NotificationCategory|keyof typeof google.cloud.essentialcontacts.v1.NotificationCategory|null); + } + + /** Represents a SendTestMessageRequest. */ + class SendTestMessageRequest implements ISendTestMessageRequest { + + /** + * Constructs a new SendTestMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.essentialcontacts.v1.ISendTestMessageRequest); + + /** SendTestMessageRequest contacts. */ + public contacts: string[]; + + /** SendTestMessageRequest resource. */ + public resource: string; + + /** SendTestMessageRequest notificationCategory. */ + public notificationCategory: (google.cloud.essentialcontacts.v1.NotificationCategory|keyof typeof google.cloud.essentialcontacts.v1.NotificationCategory); + + /** + * Creates a new SendTestMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SendTestMessageRequest instance + */ + public static create(properties?: google.cloud.essentialcontacts.v1.ISendTestMessageRequest): google.cloud.essentialcontacts.v1.SendTestMessageRequest; + + /** + * Encodes the specified SendTestMessageRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.SendTestMessageRequest.verify|verify} messages. + * @param message SendTestMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.essentialcontacts.v1.ISendTestMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SendTestMessageRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.SendTestMessageRequest.verify|verify} messages. + * @param message SendTestMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.essentialcontacts.v1.ISendTestMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SendTestMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SendTestMessageRequest + * @throws {Error} If the payload is not 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.essentialcontacts.v1.SendTestMessageRequest; + + /** + * Decodes a SendTestMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SendTestMessageRequest + * @throws {Error} If the payload 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.essentialcontacts.v1.SendTestMessageRequest; + + /** + * Verifies a SendTestMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SendTestMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SendTestMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.essentialcontacts.v1.SendTestMessageRequest; + + /** + * Creates a plain object from a SendTestMessageRequest message. Also converts values to other types if specified. + * @param message SendTestMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.essentialcontacts.v1.SendTestMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SendTestMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** 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 Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/packages/google-cloud-essentialcontacts/protos/protos.js b/packages/google-cloud-essentialcontacts/protos/protos.js new file mode 100644 index 00000000000..2f567e6ba45 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/protos/protos.js @@ -0,0 +1,13771 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_essential_contacts_protos || ($protobuf.roots._google_cloud_essential_contacts_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.essentialcontacts = (function() { + + /** + * Namespace essentialcontacts. + * @memberof google.cloud + * @namespace + */ + var essentialcontacts = {}; + + essentialcontacts.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.essentialcontacts + * @namespace + */ + var v1 = {}; + + /** + * NotificationCategory enum. + * @name google.cloud.essentialcontacts.v1.NotificationCategory + * @enum {number} + * @property {number} NOTIFICATION_CATEGORY_UNSPECIFIED=0 NOTIFICATION_CATEGORY_UNSPECIFIED value + * @property {number} ALL=2 ALL value + * @property {number} SUSPENSION=3 SUSPENSION value + * @property {number} SECURITY=5 SECURITY value + * @property {number} TECHNICAL=6 TECHNICAL value + * @property {number} BILLING=7 BILLING value + * @property {number} LEGAL=8 LEGAL value + * @property {number} PRODUCT_UPDATES=9 PRODUCT_UPDATES value + * @property {number} TECHNICAL_INCIDENTS=10 TECHNICAL_INCIDENTS value + */ + v1.NotificationCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NOTIFICATION_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[2] = "ALL"] = 2; + values[valuesById[3] = "SUSPENSION"] = 3; + values[valuesById[5] = "SECURITY"] = 5; + values[valuesById[6] = "TECHNICAL"] = 6; + values[valuesById[7] = "BILLING"] = 7; + values[valuesById[8] = "LEGAL"] = 8; + values[valuesById[9] = "PRODUCT_UPDATES"] = 9; + values[valuesById[10] = "TECHNICAL_INCIDENTS"] = 10; + return values; + })(); + + /** + * ValidationState enum. + * @name google.cloud.essentialcontacts.v1.ValidationState + * @enum {number} + * @property {number} VALIDATION_STATE_UNSPECIFIED=0 VALIDATION_STATE_UNSPECIFIED value + * @property {number} VALID=1 VALID value + * @property {number} INVALID=2 INVALID value + */ + v1.ValidationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALIDATION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VALID"] = 1; + values[valuesById[2] = "INVALID"] = 2; + return values; + })(); + + v1.EssentialContactsService = (function() { + + /** + * Constructs a new EssentialContactsService service. + * @memberof google.cloud.essentialcontacts.v1 + * @classdesc Represents an EssentialContactsService + * @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 EssentialContactsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (EssentialContactsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EssentialContactsService; + + /** + * Creates new EssentialContactsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @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 {EssentialContactsService} RPC service. Useful where requests and/or responses are streamed. + */ + EssentialContactsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#createContact}. + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @typedef CreateContactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.essentialcontacts.v1.Contact} [response] Contact + */ + + /** + * Calls CreateContact. + * @function createContact + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.ICreateContactRequest} request CreateContactRequest message or plain object + * @param {google.cloud.essentialcontacts.v1.EssentialContactsService.CreateContactCallback} callback Node-style callback called with the error, if any, and Contact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EssentialContactsService.prototype.createContact = function createContact(request, callback) { + return this.rpcCall(createContact, $root.google.cloud.essentialcontacts.v1.CreateContactRequest, $root.google.cloud.essentialcontacts.v1.Contact, request, callback); + }, "name", { value: "CreateContact" }); + + /** + * Calls CreateContact. + * @function createContact + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.ICreateContactRequest} request CreateContactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#updateContact}. + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @typedef UpdateContactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.essentialcontacts.v1.Contact} [response] Contact + */ + + /** + * Calls UpdateContact. + * @function updateContact + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.IUpdateContactRequest} request UpdateContactRequest message or plain object + * @param {google.cloud.essentialcontacts.v1.EssentialContactsService.UpdateContactCallback} callback Node-style callback called with the error, if any, and Contact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EssentialContactsService.prototype.updateContact = function updateContact(request, callback) { + return this.rpcCall(updateContact, $root.google.cloud.essentialcontacts.v1.UpdateContactRequest, $root.google.cloud.essentialcontacts.v1.Contact, request, callback); + }, "name", { value: "UpdateContact" }); + + /** + * Calls UpdateContact. + * @function updateContact + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.IUpdateContactRequest} request UpdateContactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#listContacts}. + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @typedef ListContactsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.essentialcontacts.v1.ListContactsResponse} [response] ListContactsResponse + */ + + /** + * Calls ListContacts. + * @function listContacts + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.IListContactsRequest} request ListContactsRequest message or plain object + * @param {google.cloud.essentialcontacts.v1.EssentialContactsService.ListContactsCallback} callback Node-style callback called with the error, if any, and ListContactsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EssentialContactsService.prototype.listContacts = function listContacts(request, callback) { + return this.rpcCall(listContacts, $root.google.cloud.essentialcontacts.v1.ListContactsRequest, $root.google.cloud.essentialcontacts.v1.ListContactsResponse, request, callback); + }, "name", { value: "ListContacts" }); + + /** + * Calls ListContacts. + * @function listContacts + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.IListContactsRequest} request ListContactsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#getContact}. + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @typedef GetContactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.essentialcontacts.v1.Contact} [response] Contact + */ + + /** + * Calls GetContact. + * @function getContact + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.IGetContactRequest} request GetContactRequest message or plain object + * @param {google.cloud.essentialcontacts.v1.EssentialContactsService.GetContactCallback} callback Node-style callback called with the error, if any, and Contact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EssentialContactsService.prototype.getContact = function getContact(request, callback) { + return this.rpcCall(getContact, $root.google.cloud.essentialcontacts.v1.GetContactRequest, $root.google.cloud.essentialcontacts.v1.Contact, request, callback); + }, "name", { value: "GetContact" }); + + /** + * Calls GetContact. + * @function getContact + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.IGetContactRequest} request GetContactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#deleteContact}. + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @typedef DeleteContactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteContact. + * @function deleteContact + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.IDeleteContactRequest} request DeleteContactRequest message or plain object + * @param {google.cloud.essentialcontacts.v1.EssentialContactsService.DeleteContactCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EssentialContactsService.prototype.deleteContact = function deleteContact(request, callback) { + return this.rpcCall(deleteContact, $root.google.cloud.essentialcontacts.v1.DeleteContactRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteContact" }); + + /** + * Calls DeleteContact. + * @function deleteContact + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.IDeleteContactRequest} request DeleteContactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#computeContacts}. + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @typedef ComputeContactsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.essentialcontacts.v1.ComputeContactsResponse} [response] ComputeContactsResponse + */ + + /** + * Calls ComputeContacts. + * @function computeContacts + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.IComputeContactsRequest} request ComputeContactsRequest message or plain object + * @param {google.cloud.essentialcontacts.v1.EssentialContactsService.ComputeContactsCallback} callback Node-style callback called with the error, if any, and ComputeContactsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EssentialContactsService.prototype.computeContacts = function computeContacts(request, callback) { + return this.rpcCall(computeContacts, $root.google.cloud.essentialcontacts.v1.ComputeContactsRequest, $root.google.cloud.essentialcontacts.v1.ComputeContactsResponse, request, callback); + }, "name", { value: "ComputeContacts" }); + + /** + * Calls ComputeContacts. + * @function computeContacts + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.IComputeContactsRequest} request ComputeContactsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#sendTestMessage}. + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @typedef SendTestMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls SendTestMessage. + * @function sendTestMessage + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.ISendTestMessageRequest} request SendTestMessageRequest message or plain object + * @param {google.cloud.essentialcontacts.v1.EssentialContactsService.SendTestMessageCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EssentialContactsService.prototype.sendTestMessage = function sendTestMessage(request, callback) { + return this.rpcCall(sendTestMessage, $root.google.cloud.essentialcontacts.v1.SendTestMessageRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "SendTestMessage" }); + + /** + * Calls SendTestMessage. + * @function sendTestMessage + * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService + * @instance + * @param {google.cloud.essentialcontacts.v1.ISendTestMessageRequest} request SendTestMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return EssentialContactsService; + })(); + + v1.Contact = (function() { + + /** + * Properties of a Contact. + * @memberof google.cloud.essentialcontacts.v1 + * @interface IContact + * @property {string|null} [name] Contact name + * @property {string|null} [email] Contact email + * @property {Array.|null} [notificationCategorySubscriptions] Contact notificationCategorySubscriptions + * @property {string|null} [languageTag] Contact languageTag + * @property {google.cloud.essentialcontacts.v1.ValidationState|null} [validationState] Contact validationState + * @property {google.protobuf.ITimestamp|null} [validateTime] Contact validateTime + */ + + /** + * Constructs a new Contact. + * @memberof google.cloud.essentialcontacts.v1 + * @classdesc Represents a Contact. + * @implements IContact + * @constructor + * @param {google.cloud.essentialcontacts.v1.IContact=} [properties] Properties to set + */ + function Contact(properties) { + this.notificationCategorySubscriptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Contact name. + * @member {string} name + * @memberof google.cloud.essentialcontacts.v1.Contact + * @instance + */ + Contact.prototype.name = ""; + + /** + * Contact email. + * @member {string} email + * @memberof google.cloud.essentialcontacts.v1.Contact + * @instance + */ + Contact.prototype.email = ""; + + /** + * Contact notificationCategorySubscriptions. + * @member {Array.} notificationCategorySubscriptions + * @memberof google.cloud.essentialcontacts.v1.Contact + * @instance + */ + Contact.prototype.notificationCategorySubscriptions = $util.emptyArray; + + /** + * Contact languageTag. + * @member {string} languageTag + * @memberof google.cloud.essentialcontacts.v1.Contact + * @instance + */ + Contact.prototype.languageTag = ""; + + /** + * Contact validationState. + * @member {google.cloud.essentialcontacts.v1.ValidationState} validationState + * @memberof google.cloud.essentialcontacts.v1.Contact + * @instance + */ + Contact.prototype.validationState = 0; + + /** + * Contact validateTime. + * @member {google.protobuf.ITimestamp|null|undefined} validateTime + * @memberof google.cloud.essentialcontacts.v1.Contact + * @instance + */ + Contact.prototype.validateTime = null; + + /** + * Creates a new Contact instance using the specified properties. + * @function create + * @memberof google.cloud.essentialcontacts.v1.Contact + * @static + * @param {google.cloud.essentialcontacts.v1.IContact=} [properties] Properties to set + * @returns {google.cloud.essentialcontacts.v1.Contact} Contact instance + */ + Contact.create = function create(properties) { + return new Contact(properties); + }; + + /** + * Encodes the specified Contact message. Does not implicitly {@link google.cloud.essentialcontacts.v1.Contact.verify|verify} messages. + * @function encode + * @memberof google.cloud.essentialcontacts.v1.Contact + * @static + * @param {google.cloud.essentialcontacts.v1.IContact} message Contact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contact.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.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); + if (message.notificationCategorySubscriptions != null && message.notificationCategorySubscriptions.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.notificationCategorySubscriptions.length; ++i) + writer.int32(message.notificationCategorySubscriptions[i]); + writer.ldelim(); + } + if (message.languageTag != null && Object.hasOwnProperty.call(message, "languageTag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageTag); + if (message.validationState != null && Object.hasOwnProperty.call(message, "validationState")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.validationState); + if (message.validateTime != null && Object.hasOwnProperty.call(message, "validateTime")) + $root.google.protobuf.Timestamp.encode(message.validateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Contact message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.Contact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.essentialcontacts.v1.Contact + * @static + * @param {google.cloud.essentialcontacts.v1.IContact} message Contact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Contact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.essentialcontacts.v1.Contact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.essentialcontacts.v1.Contact} Contact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contact.decode = function 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.essentialcontacts.v1.Contact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.email = reader.string(); + break; + case 3: + if (!(message.notificationCategorySubscriptions && message.notificationCategorySubscriptions.length)) + message.notificationCategorySubscriptions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.notificationCategorySubscriptions.push(reader.int32()); + } else + message.notificationCategorySubscriptions.push(reader.int32()); + break; + case 4: + message.languageTag = reader.string(); + break; + case 8: + message.validationState = reader.int32(); + break; + case 9: + message.validateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Contact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.essentialcontacts.v1.Contact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.essentialcontacts.v1.Contact} Contact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Contact message. + * @function verify + * @memberof google.cloud.essentialcontacts.v1.Contact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Contact.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.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.notificationCategorySubscriptions != null && message.hasOwnProperty("notificationCategorySubscriptions")) { + if (!Array.isArray(message.notificationCategorySubscriptions)) + return "notificationCategorySubscriptions: array expected"; + for (var i = 0; i < message.notificationCategorySubscriptions.length; ++i) + switch (message.notificationCategorySubscriptions[i]) { + default: + return "notificationCategorySubscriptions: enum value[] expected"; + case 0: + case 2: + case 3: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + } + if (message.languageTag != null && message.hasOwnProperty("languageTag")) + if (!$util.isString(message.languageTag)) + return "languageTag: string expected"; + if (message.validationState != null && message.hasOwnProperty("validationState")) + switch (message.validationState) { + default: + return "validationState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.validateTime != null && message.hasOwnProperty("validateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.validateTime); + if (error) + return "validateTime." + error; + } + return null; + }; + + /** + * Creates a Contact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.essentialcontacts.v1.Contact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.essentialcontacts.v1.Contact} Contact + */ + Contact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.essentialcontacts.v1.Contact) + return object; + var message = new $root.google.cloud.essentialcontacts.v1.Contact(); + if (object.name != null) + message.name = String(object.name); + if (object.email != null) + message.email = String(object.email); + if (object.notificationCategorySubscriptions) { + if (!Array.isArray(object.notificationCategorySubscriptions)) + throw TypeError(".google.cloud.essentialcontacts.v1.Contact.notificationCategorySubscriptions: array expected"); + message.notificationCategorySubscriptions = []; + for (var i = 0; i < object.notificationCategorySubscriptions.length; ++i) + switch (object.notificationCategorySubscriptions[i]) { + default: + case "NOTIFICATION_CATEGORY_UNSPECIFIED": + case 0: + message.notificationCategorySubscriptions[i] = 0; + break; + case "ALL": + case 2: + message.notificationCategorySubscriptions[i] = 2; + break; + case "SUSPENSION": + case 3: + message.notificationCategorySubscriptions[i] = 3; + break; + case "SECURITY": + case 5: + message.notificationCategorySubscriptions[i] = 5; + break; + case "TECHNICAL": + case 6: + message.notificationCategorySubscriptions[i] = 6; + break; + case "BILLING": + case 7: + message.notificationCategorySubscriptions[i] = 7; + break; + case "LEGAL": + case 8: + message.notificationCategorySubscriptions[i] = 8; + break; + case "PRODUCT_UPDATES": + case 9: + message.notificationCategorySubscriptions[i] = 9; + break; + case "TECHNICAL_INCIDENTS": + case 10: + message.notificationCategorySubscriptions[i] = 10; + break; + } + } + if (object.languageTag != null) + message.languageTag = String(object.languageTag); + switch (object.validationState) { + case "VALIDATION_STATE_UNSPECIFIED": + case 0: + message.validationState = 0; + break; + case "VALID": + case 1: + message.validationState = 1; + break; + case "INVALID": + case 2: + message.validationState = 2; + break; + } + if (object.validateTime != null) { + if (typeof object.validateTime !== "object") + throw TypeError(".google.cloud.essentialcontacts.v1.Contact.validateTime: object expected"); + message.validateTime = $root.google.protobuf.Timestamp.fromObject(object.validateTime); + } + return message; + }; + + /** + * Creates a plain object from a Contact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.essentialcontacts.v1.Contact + * @static + * @param {google.cloud.essentialcontacts.v1.Contact} message Contact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Contact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.notificationCategorySubscriptions = []; + if (options.defaults) { + object.name = ""; + object.email = ""; + object.languageTag = ""; + object.validationState = options.enums === String ? "VALIDATION_STATE_UNSPECIFIED" : 0; + object.validateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.notificationCategorySubscriptions && message.notificationCategorySubscriptions.length) { + object.notificationCategorySubscriptions = []; + for (var j = 0; j < message.notificationCategorySubscriptions.length; ++j) + object.notificationCategorySubscriptions[j] = options.enums === String ? $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategorySubscriptions[j]] : message.notificationCategorySubscriptions[j]; + } + if (message.languageTag != null && message.hasOwnProperty("languageTag")) + object.languageTag = message.languageTag; + if (message.validationState != null && message.hasOwnProperty("validationState")) + object.validationState = options.enums === String ? $root.google.cloud.essentialcontacts.v1.ValidationState[message.validationState] : message.validationState; + if (message.validateTime != null && message.hasOwnProperty("validateTime")) + object.validateTime = $root.google.protobuf.Timestamp.toObject(message.validateTime, options); + return object; + }; + + /** + * Converts this Contact to JSON. + * @function toJSON + * @memberof google.cloud.essentialcontacts.v1.Contact + * @instance + * @returns {Object.} JSON object + */ + Contact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Contact; + })(); + + v1.ListContactsRequest = (function() { + + /** + * Properties of a ListContactsRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @interface IListContactsRequest + * @property {string|null} [parent] ListContactsRequest parent + * @property {number|null} [pageSize] ListContactsRequest pageSize + * @property {string|null} [pageToken] ListContactsRequest pageToken + */ + + /** + * Constructs a new ListContactsRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @classdesc Represents a ListContactsRequest. + * @implements IListContactsRequest + * @constructor + * @param {google.cloud.essentialcontacts.v1.IListContactsRequest=} [properties] Properties to set + */ + function ListContactsRequest(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]]; + } + + /** + * ListContactsRequest parent. + * @member {string} parent + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @instance + */ + ListContactsRequest.prototype.parent = ""; + + /** + * ListContactsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @instance + */ + ListContactsRequest.prototype.pageSize = 0; + + /** + * ListContactsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @instance + */ + ListContactsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListContactsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IListContactsRequest=} [properties] Properties to set + * @returns {google.cloud.essentialcontacts.v1.ListContactsRequest} ListContactsRequest instance + */ + ListContactsRequest.create = function create(properties) { + return new ListContactsRequest(properties); + }; + + /** + * Encodes the specified ListContactsRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.ListContactsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IListContactsRequest} message ListContactsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContactsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListContactsRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.ListContactsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IListContactsRequest} message ListContactsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContactsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContactsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.essentialcontacts.v1.ListContactsRequest} ListContactsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContactsRequest.decode = function 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.essentialcontacts.v1.ListContactsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListContactsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.essentialcontacts.v1.ListContactsRequest} ListContactsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContactsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContactsRequest message. + * @function verify + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContactsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListContactsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.essentialcontacts.v1.ListContactsRequest} ListContactsRequest + */ + ListContactsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.essentialcontacts.v1.ListContactsRequest) + return object; + var message = new $root.google.cloud.essentialcontacts.v1.ListContactsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListContactsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @static + * @param {google.cloud.essentialcontacts.v1.ListContactsRequest} message ListContactsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContactsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListContactsRequest to JSON. + * @function toJSON + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @instance + * @returns {Object.} JSON object + */ + ListContactsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListContactsRequest; + })(); + + v1.ListContactsResponse = (function() { + + /** + * Properties of a ListContactsResponse. + * @memberof google.cloud.essentialcontacts.v1 + * @interface IListContactsResponse + * @property {Array.|null} [contacts] ListContactsResponse contacts + * @property {string|null} [nextPageToken] ListContactsResponse nextPageToken + */ + + /** + * Constructs a new ListContactsResponse. + * @memberof google.cloud.essentialcontacts.v1 + * @classdesc Represents a ListContactsResponse. + * @implements IListContactsResponse + * @constructor + * @param {google.cloud.essentialcontacts.v1.IListContactsResponse=} [properties] Properties to set + */ + function ListContactsResponse(properties) { + this.contacts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListContactsResponse contacts. + * @member {Array.} contacts + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @instance + */ + ListContactsResponse.prototype.contacts = $util.emptyArray; + + /** + * ListContactsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @instance + */ + ListContactsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListContactsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @static + * @param {google.cloud.essentialcontacts.v1.IListContactsResponse=} [properties] Properties to set + * @returns {google.cloud.essentialcontacts.v1.ListContactsResponse} ListContactsResponse instance + */ + ListContactsResponse.create = function create(properties) { + return new ListContactsResponse(properties); + }; + + /** + * Encodes the specified ListContactsResponse message. Does not implicitly {@link google.cloud.essentialcontacts.v1.ListContactsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @static + * @param {google.cloud.essentialcontacts.v1.IListContactsResponse} message ListContactsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContactsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contacts != null && message.contacts.length) + for (var i = 0; i < message.contacts.length; ++i) + $root.google.cloud.essentialcontacts.v1.Contact.encode(message.contacts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListContactsResponse message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.ListContactsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @static + * @param {google.cloud.essentialcontacts.v1.IListContactsResponse} message ListContactsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContactsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContactsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.essentialcontacts.v1.ListContactsResponse} ListContactsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContactsResponse.decode = function 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.essentialcontacts.v1.ListContactsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push($root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListContactsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.essentialcontacts.v1.ListContactsResponse} ListContactsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContactsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContactsResponse message. + * @function verify + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContactsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contacts != null && message.hasOwnProperty("contacts")) { + if (!Array.isArray(message.contacts)) + return "contacts: array expected"; + for (var i = 0; i < message.contacts.length; ++i) { + var error = $root.google.cloud.essentialcontacts.v1.Contact.verify(message.contacts[i]); + if (error) + return "contacts." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListContactsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.essentialcontacts.v1.ListContactsResponse} ListContactsResponse + */ + ListContactsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.essentialcontacts.v1.ListContactsResponse) + return object; + var message = new $root.google.cloud.essentialcontacts.v1.ListContactsResponse(); + if (object.contacts) { + if (!Array.isArray(object.contacts)) + throw TypeError(".google.cloud.essentialcontacts.v1.ListContactsResponse.contacts: array expected"); + message.contacts = []; + for (var i = 0; i < object.contacts.length; ++i) { + if (typeof object.contacts[i] !== "object") + throw TypeError(".google.cloud.essentialcontacts.v1.ListContactsResponse.contacts: object expected"); + message.contacts[i] = $root.google.cloud.essentialcontacts.v1.Contact.fromObject(object.contacts[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListContactsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @static + * @param {google.cloud.essentialcontacts.v1.ListContactsResponse} message ListContactsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContactsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contacts = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.contacts && message.contacts.length) { + object.contacts = []; + for (var j = 0; j < message.contacts.length; ++j) + object.contacts[j] = $root.google.cloud.essentialcontacts.v1.Contact.toObject(message.contacts[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListContactsResponse to JSON. + * @function toJSON + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @instance + * @returns {Object.} JSON object + */ + ListContactsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListContactsResponse; + })(); + + v1.GetContactRequest = (function() { + + /** + * Properties of a GetContactRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @interface IGetContactRequest + * @property {string|null} [name] GetContactRequest name + */ + + /** + * Constructs a new GetContactRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @classdesc Represents a GetContactRequest. + * @implements IGetContactRequest + * @constructor + * @param {google.cloud.essentialcontacts.v1.IGetContactRequest=} [properties] Properties to set + */ + function GetContactRequest(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]]; + } + + /** + * GetContactRequest name. + * @member {string} name + * @memberof google.cloud.essentialcontacts.v1.GetContactRequest + * @instance + */ + GetContactRequest.prototype.name = ""; + + /** + * Creates a new GetContactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.essentialcontacts.v1.GetContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IGetContactRequest=} [properties] Properties to set + * @returns {google.cloud.essentialcontacts.v1.GetContactRequest} GetContactRequest instance + */ + GetContactRequest.create = function create(properties) { + return new GetContactRequest(properties); + }; + + /** + * Encodes the specified GetContactRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.GetContactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.essentialcontacts.v1.GetContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IGetContactRequest} message GetContactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContactRequest.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 GetContactRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.GetContactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.essentialcontacts.v1.GetContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IGetContactRequest} message GetContactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.essentialcontacts.v1.GetContactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.essentialcontacts.v1.GetContactRequest} GetContactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContactRequest.decode = function 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.essentialcontacts.v1.GetContactRequest(); + 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 GetContactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.essentialcontacts.v1.GetContactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.essentialcontacts.v1.GetContactRequest} GetContactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContactRequest message. + * @function verify + * @memberof google.cloud.essentialcontacts.v1.GetContactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContactRequest.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 GetContactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.essentialcontacts.v1.GetContactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.essentialcontacts.v1.GetContactRequest} GetContactRequest + */ + GetContactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.essentialcontacts.v1.GetContactRequest) + return object; + var message = new $root.google.cloud.essentialcontacts.v1.GetContactRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetContactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.essentialcontacts.v1.GetContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.GetContactRequest} message GetContactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContactRequest.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 GetContactRequest to JSON. + * @function toJSON + * @memberof google.cloud.essentialcontacts.v1.GetContactRequest + * @instance + * @returns {Object.} JSON object + */ + GetContactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetContactRequest; + })(); + + v1.DeleteContactRequest = (function() { + + /** + * Properties of a DeleteContactRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @interface IDeleteContactRequest + * @property {string|null} [name] DeleteContactRequest name + */ + + /** + * Constructs a new DeleteContactRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @classdesc Represents a DeleteContactRequest. + * @implements IDeleteContactRequest + * @constructor + * @param {google.cloud.essentialcontacts.v1.IDeleteContactRequest=} [properties] Properties to set + */ + function DeleteContactRequest(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]]; + } + + /** + * DeleteContactRequest name. + * @member {string} name + * @memberof google.cloud.essentialcontacts.v1.DeleteContactRequest + * @instance + */ + DeleteContactRequest.prototype.name = ""; + + /** + * Creates a new DeleteContactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.essentialcontacts.v1.DeleteContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IDeleteContactRequest=} [properties] Properties to set + * @returns {google.cloud.essentialcontacts.v1.DeleteContactRequest} DeleteContactRequest instance + */ + DeleteContactRequest.create = function create(properties) { + return new DeleteContactRequest(properties); + }; + + /** + * Encodes the specified DeleteContactRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.DeleteContactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.essentialcontacts.v1.DeleteContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IDeleteContactRequest} message DeleteContactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteContactRequest.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 DeleteContactRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.DeleteContactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.essentialcontacts.v1.DeleteContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IDeleteContactRequest} message DeleteContactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteContactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteContactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.essentialcontacts.v1.DeleteContactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.essentialcontacts.v1.DeleteContactRequest} DeleteContactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteContactRequest.decode = function 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.essentialcontacts.v1.DeleteContactRequest(); + 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 DeleteContactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.essentialcontacts.v1.DeleteContactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.essentialcontacts.v1.DeleteContactRequest} DeleteContactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteContactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteContactRequest message. + * @function verify + * @memberof google.cloud.essentialcontacts.v1.DeleteContactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteContactRequest.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 DeleteContactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.essentialcontacts.v1.DeleteContactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.essentialcontacts.v1.DeleteContactRequest} DeleteContactRequest + */ + DeleteContactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.essentialcontacts.v1.DeleteContactRequest) + return object; + var message = new $root.google.cloud.essentialcontacts.v1.DeleteContactRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteContactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.essentialcontacts.v1.DeleteContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.DeleteContactRequest} message DeleteContactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteContactRequest.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 DeleteContactRequest to JSON. + * @function toJSON + * @memberof google.cloud.essentialcontacts.v1.DeleteContactRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteContactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteContactRequest; + })(); + + v1.CreateContactRequest = (function() { + + /** + * Properties of a CreateContactRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @interface ICreateContactRequest + * @property {string|null} [parent] CreateContactRequest parent + * @property {google.cloud.essentialcontacts.v1.IContact|null} [contact] CreateContactRequest contact + */ + + /** + * Constructs a new CreateContactRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @classdesc Represents a CreateContactRequest. + * @implements ICreateContactRequest + * @constructor + * @param {google.cloud.essentialcontacts.v1.ICreateContactRequest=} [properties] Properties to set + */ + function CreateContactRequest(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]]; + } + + /** + * CreateContactRequest parent. + * @member {string} parent + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @instance + */ + CreateContactRequest.prototype.parent = ""; + + /** + * CreateContactRequest contact. + * @member {google.cloud.essentialcontacts.v1.IContact|null|undefined} contact + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @instance + */ + CreateContactRequest.prototype.contact = null; + + /** + * Creates a new CreateContactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.ICreateContactRequest=} [properties] Properties to set + * @returns {google.cloud.essentialcontacts.v1.CreateContactRequest} CreateContactRequest instance + */ + CreateContactRequest.create = function create(properties) { + return new CreateContactRequest(properties); + }; + + /** + * Encodes the specified CreateContactRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.CreateContactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.ICreateContactRequest} message CreateContactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateContactRequest.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.contact != null && Object.hasOwnProperty.call(message, "contact")) + $root.google.cloud.essentialcontacts.v1.Contact.encode(message.contact, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateContactRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.CreateContactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.ICreateContactRequest} message CreateContactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateContactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateContactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.essentialcontacts.v1.CreateContactRequest} CreateContactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateContactRequest.decode = function 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.essentialcontacts.v1.CreateContactRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.contact = $root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateContactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.essentialcontacts.v1.CreateContactRequest} CreateContactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateContactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateContactRequest message. + * @function verify + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateContactRequest.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.contact != null && message.hasOwnProperty("contact")) { + var error = $root.google.cloud.essentialcontacts.v1.Contact.verify(message.contact); + if (error) + return "contact." + error; + } + return null; + }; + + /** + * Creates a CreateContactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.essentialcontacts.v1.CreateContactRequest} CreateContactRequest + */ + CreateContactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.essentialcontacts.v1.CreateContactRequest) + return object; + var message = new $root.google.cloud.essentialcontacts.v1.CreateContactRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.contact != null) { + if (typeof object.contact !== "object") + throw TypeError(".google.cloud.essentialcontacts.v1.CreateContactRequest.contact: object expected"); + message.contact = $root.google.cloud.essentialcontacts.v1.Contact.fromObject(object.contact); + } + return message; + }; + + /** + * Creates a plain object from a CreateContactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.CreateContactRequest} message CreateContactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateContactRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.contact = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.contact != null && message.hasOwnProperty("contact")) + object.contact = $root.google.cloud.essentialcontacts.v1.Contact.toObject(message.contact, options); + return object; + }; + + /** + * Converts this CreateContactRequest to JSON. + * @function toJSON + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @instance + * @returns {Object.} JSON object + */ + CreateContactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateContactRequest; + })(); + + v1.UpdateContactRequest = (function() { + + /** + * Properties of an UpdateContactRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @interface IUpdateContactRequest + * @property {google.cloud.essentialcontacts.v1.IContact|null} [contact] UpdateContactRequest contact + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateContactRequest updateMask + */ + + /** + * Constructs a new UpdateContactRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @classdesc Represents an UpdateContactRequest. + * @implements IUpdateContactRequest + * @constructor + * @param {google.cloud.essentialcontacts.v1.IUpdateContactRequest=} [properties] Properties to set + */ + function UpdateContactRequest(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]]; + } + + /** + * UpdateContactRequest contact. + * @member {google.cloud.essentialcontacts.v1.IContact|null|undefined} contact + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @instance + */ + UpdateContactRequest.prototype.contact = null; + + /** + * UpdateContactRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @instance + */ + UpdateContactRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateContactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IUpdateContactRequest=} [properties] Properties to set + * @returns {google.cloud.essentialcontacts.v1.UpdateContactRequest} UpdateContactRequest instance + */ + UpdateContactRequest.create = function create(properties) { + return new UpdateContactRequest(properties); + }; + + /** + * Encodes the specified UpdateContactRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.UpdateContactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IUpdateContactRequest} message UpdateContactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateContactRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contact != null && Object.hasOwnProperty.call(message, "contact")) + $root.google.cloud.essentialcontacts.v1.Contact.encode(message.contact, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateContactRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.UpdateContactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IUpdateContactRequest} message UpdateContactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateContactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateContactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.essentialcontacts.v1.UpdateContactRequest} UpdateContactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateContactRequest.decode = function 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.essentialcontacts.v1.UpdateContactRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.contact = $root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32()); + break; + case 3: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateContactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.essentialcontacts.v1.UpdateContactRequest} UpdateContactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateContactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateContactRequest message. + * @function verify + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateContactRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contact != null && message.hasOwnProperty("contact")) { + var error = $root.google.cloud.essentialcontacts.v1.Contact.verify(message.contact); + if (error) + return "contact." + 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 UpdateContactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.essentialcontacts.v1.UpdateContactRequest} UpdateContactRequest + */ + UpdateContactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.essentialcontacts.v1.UpdateContactRequest) + return object; + var message = new $root.google.cloud.essentialcontacts.v1.UpdateContactRequest(); + if (object.contact != null) { + if (typeof object.contact !== "object") + throw TypeError(".google.cloud.essentialcontacts.v1.UpdateContactRequest.contact: object expected"); + message.contact = $root.google.cloud.essentialcontacts.v1.Contact.fromObject(object.contact); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.essentialcontacts.v1.UpdateContactRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateContactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @static + * @param {google.cloud.essentialcontacts.v1.UpdateContactRequest} message UpdateContactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateContactRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.contact = null; + object.updateMask = null; + } + if (message.contact != null && message.hasOwnProperty("contact")) + object.contact = $root.google.cloud.essentialcontacts.v1.Contact.toObject(message.contact, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateContactRequest to JSON. + * @function toJSON + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateContactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateContactRequest; + })(); + + v1.ComputeContactsRequest = (function() { + + /** + * Properties of a ComputeContactsRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @interface IComputeContactsRequest + * @property {string|null} [parent] ComputeContactsRequest parent + * @property {Array.|null} [notificationCategories] ComputeContactsRequest notificationCategories + * @property {number|null} [pageSize] ComputeContactsRequest pageSize + * @property {string|null} [pageToken] ComputeContactsRequest pageToken + */ + + /** + * Constructs a new ComputeContactsRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @classdesc Represents a ComputeContactsRequest. + * @implements IComputeContactsRequest + * @constructor + * @param {google.cloud.essentialcontacts.v1.IComputeContactsRequest=} [properties] Properties to set + */ + function ComputeContactsRequest(properties) { + this.notificationCategories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeContactsRequest parent. + * @member {string} parent + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @instance + */ + ComputeContactsRequest.prototype.parent = ""; + + /** + * ComputeContactsRequest notificationCategories. + * @member {Array.} notificationCategories + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @instance + */ + ComputeContactsRequest.prototype.notificationCategories = $util.emptyArray; + + /** + * ComputeContactsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @instance + */ + ComputeContactsRequest.prototype.pageSize = 0; + + /** + * ComputeContactsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @instance + */ + ComputeContactsRequest.prototype.pageToken = ""; + + /** + * Creates a new ComputeContactsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IComputeContactsRequest=} [properties] Properties to set + * @returns {google.cloud.essentialcontacts.v1.ComputeContactsRequest} ComputeContactsRequest instance + */ + ComputeContactsRequest.create = function create(properties) { + return new ComputeContactsRequest(properties); + }; + + /** + * Encodes the specified ComputeContactsRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.ComputeContactsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IComputeContactsRequest} message ComputeContactsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeContactsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.notificationCategories != null && message.notificationCategories.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.notificationCategories.length; ++i) + writer.int32(message.notificationCategories[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ComputeContactsRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.ComputeContactsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @static + * @param {google.cloud.essentialcontacts.v1.IComputeContactsRequest} message ComputeContactsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeContactsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeContactsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.essentialcontacts.v1.ComputeContactsRequest} ComputeContactsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeContactsRequest.decode = function 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.essentialcontacts.v1.ComputeContactsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 6: + if (!(message.notificationCategories && message.notificationCategories.length)) + message.notificationCategories = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.notificationCategories.push(reader.int32()); + } else + message.notificationCategories.push(reader.int32()); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeContactsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.essentialcontacts.v1.ComputeContactsRequest} ComputeContactsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeContactsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeContactsRequest message. + * @function verify + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeContactsRequest.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.notificationCategories != null && message.hasOwnProperty("notificationCategories")) { + if (!Array.isArray(message.notificationCategories)) + return "notificationCategories: array expected"; + for (var i = 0; i < message.notificationCategories.length; ++i) + switch (message.notificationCategories[i]) { + default: + return "notificationCategories: enum value[] expected"; + case 0: + case 2: + case 3: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ComputeContactsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.essentialcontacts.v1.ComputeContactsRequest} ComputeContactsRequest + */ + ComputeContactsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.essentialcontacts.v1.ComputeContactsRequest) + return object; + var message = new $root.google.cloud.essentialcontacts.v1.ComputeContactsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.notificationCategories) { + if (!Array.isArray(object.notificationCategories)) + throw TypeError(".google.cloud.essentialcontacts.v1.ComputeContactsRequest.notificationCategories: array expected"); + message.notificationCategories = []; + for (var i = 0; i < object.notificationCategories.length; ++i) + switch (object.notificationCategories[i]) { + default: + case "NOTIFICATION_CATEGORY_UNSPECIFIED": + case 0: + message.notificationCategories[i] = 0; + break; + case "ALL": + case 2: + message.notificationCategories[i] = 2; + break; + case "SUSPENSION": + case 3: + message.notificationCategories[i] = 3; + break; + case "SECURITY": + case 5: + message.notificationCategories[i] = 5; + break; + case "TECHNICAL": + case 6: + message.notificationCategories[i] = 6; + break; + case "BILLING": + case 7: + message.notificationCategories[i] = 7; + break; + case "LEGAL": + case 8: + message.notificationCategories[i] = 8; + break; + case "PRODUCT_UPDATES": + case 9: + message.notificationCategories[i] = 9; + break; + case "TECHNICAL_INCIDENTS": + case 10: + message.notificationCategories[i] = 10; + break; + } + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ComputeContactsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @static + * @param {google.cloud.essentialcontacts.v1.ComputeContactsRequest} message ComputeContactsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeContactsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.notificationCategories = []; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.notificationCategories && message.notificationCategories.length) { + object.notificationCategories = []; + for (var j = 0; j < message.notificationCategories.length; ++j) + object.notificationCategories[j] = options.enums === String ? $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategories[j]] : message.notificationCategories[j]; + } + return object; + }; + + /** + * Converts this ComputeContactsRequest to JSON. + * @function toJSON + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @instance + * @returns {Object.} JSON object + */ + ComputeContactsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ComputeContactsRequest; + })(); + + v1.ComputeContactsResponse = (function() { + + /** + * Properties of a ComputeContactsResponse. + * @memberof google.cloud.essentialcontacts.v1 + * @interface IComputeContactsResponse + * @property {Array.|null} [contacts] ComputeContactsResponse contacts + * @property {string|null} [nextPageToken] ComputeContactsResponse nextPageToken + */ + + /** + * Constructs a new ComputeContactsResponse. + * @memberof google.cloud.essentialcontacts.v1 + * @classdesc Represents a ComputeContactsResponse. + * @implements IComputeContactsResponse + * @constructor + * @param {google.cloud.essentialcontacts.v1.IComputeContactsResponse=} [properties] Properties to set + */ + function ComputeContactsResponse(properties) { + this.contacts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeContactsResponse contacts. + * @member {Array.} contacts + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @instance + */ + ComputeContactsResponse.prototype.contacts = $util.emptyArray; + + /** + * ComputeContactsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @instance + */ + ComputeContactsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ComputeContactsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @static + * @param {google.cloud.essentialcontacts.v1.IComputeContactsResponse=} [properties] Properties to set + * @returns {google.cloud.essentialcontacts.v1.ComputeContactsResponse} ComputeContactsResponse instance + */ + ComputeContactsResponse.create = function create(properties) { + return new ComputeContactsResponse(properties); + }; + + /** + * Encodes the specified ComputeContactsResponse message. Does not implicitly {@link google.cloud.essentialcontacts.v1.ComputeContactsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @static + * @param {google.cloud.essentialcontacts.v1.IComputeContactsResponse} message ComputeContactsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeContactsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contacts != null && message.contacts.length) + for (var i = 0; i < message.contacts.length; ++i) + $root.google.cloud.essentialcontacts.v1.Contact.encode(message.contacts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ComputeContactsResponse message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.ComputeContactsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @static + * @param {google.cloud.essentialcontacts.v1.IComputeContactsResponse} message ComputeContactsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeContactsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeContactsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.essentialcontacts.v1.ComputeContactsResponse} ComputeContactsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeContactsResponse.decode = function 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.essentialcontacts.v1.ComputeContactsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push($root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeContactsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.essentialcontacts.v1.ComputeContactsResponse} ComputeContactsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeContactsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeContactsResponse message. + * @function verify + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeContactsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contacts != null && message.hasOwnProperty("contacts")) { + if (!Array.isArray(message.contacts)) + return "contacts: array expected"; + for (var i = 0; i < message.contacts.length; ++i) { + var error = $root.google.cloud.essentialcontacts.v1.Contact.verify(message.contacts[i]); + if (error) + return "contacts." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ComputeContactsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.essentialcontacts.v1.ComputeContactsResponse} ComputeContactsResponse + */ + ComputeContactsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.essentialcontacts.v1.ComputeContactsResponse) + return object; + var message = new $root.google.cloud.essentialcontacts.v1.ComputeContactsResponse(); + if (object.contacts) { + if (!Array.isArray(object.contacts)) + throw TypeError(".google.cloud.essentialcontacts.v1.ComputeContactsResponse.contacts: array expected"); + message.contacts = []; + for (var i = 0; i < object.contacts.length; ++i) { + if (typeof object.contacts[i] !== "object") + throw TypeError(".google.cloud.essentialcontacts.v1.ComputeContactsResponse.contacts: object expected"); + message.contacts[i] = $root.google.cloud.essentialcontacts.v1.Contact.fromObject(object.contacts[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ComputeContactsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @static + * @param {google.cloud.essentialcontacts.v1.ComputeContactsResponse} message ComputeContactsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeContactsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contacts = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.contacts && message.contacts.length) { + object.contacts = []; + for (var j = 0; j < message.contacts.length; ++j) + object.contacts[j] = $root.google.cloud.essentialcontacts.v1.Contact.toObject(message.contacts[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ComputeContactsResponse to JSON. + * @function toJSON + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @instance + * @returns {Object.} JSON object + */ + ComputeContactsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ComputeContactsResponse; + })(); + + v1.SendTestMessageRequest = (function() { + + /** + * Properties of a SendTestMessageRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @interface ISendTestMessageRequest + * @property {Array.|null} [contacts] SendTestMessageRequest contacts + * @property {string|null} [resource] SendTestMessageRequest resource + * @property {google.cloud.essentialcontacts.v1.NotificationCategory|null} [notificationCategory] SendTestMessageRequest notificationCategory + */ + + /** + * Constructs a new SendTestMessageRequest. + * @memberof google.cloud.essentialcontacts.v1 + * @classdesc Represents a SendTestMessageRequest. + * @implements ISendTestMessageRequest + * @constructor + * @param {google.cloud.essentialcontacts.v1.ISendTestMessageRequest=} [properties] Properties to set + */ + function SendTestMessageRequest(properties) { + this.contacts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SendTestMessageRequest contacts. + * @member {Array.} contacts + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @instance + */ + SendTestMessageRequest.prototype.contacts = $util.emptyArray; + + /** + * SendTestMessageRequest resource. + * @member {string} resource + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @instance + */ + SendTestMessageRequest.prototype.resource = ""; + + /** + * SendTestMessageRequest notificationCategory. + * @member {google.cloud.essentialcontacts.v1.NotificationCategory} notificationCategory + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @instance + */ + SendTestMessageRequest.prototype.notificationCategory = 0; + + /** + * Creates a new SendTestMessageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @static + * @param {google.cloud.essentialcontacts.v1.ISendTestMessageRequest=} [properties] Properties to set + * @returns {google.cloud.essentialcontacts.v1.SendTestMessageRequest} SendTestMessageRequest instance + */ + SendTestMessageRequest.create = function create(properties) { + return new SendTestMessageRequest(properties); + }; + + /** + * Encodes the specified SendTestMessageRequest message. Does not implicitly {@link google.cloud.essentialcontacts.v1.SendTestMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @static + * @param {google.cloud.essentialcontacts.v1.ISendTestMessageRequest} message SendTestMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendTestMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contacts != null && message.contacts.length) + for (var i = 0; i < message.contacts.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.contacts[i]); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); + if (message.notificationCategory != null && Object.hasOwnProperty.call(message, "notificationCategory")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.notificationCategory); + return writer; + }; + + /** + * Encodes the specified SendTestMessageRequest message, length delimited. Does not implicitly {@link google.cloud.essentialcontacts.v1.SendTestMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @static + * @param {google.cloud.essentialcontacts.v1.ISendTestMessageRequest} message SendTestMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendTestMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SendTestMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.essentialcontacts.v1.SendTestMessageRequest} SendTestMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendTestMessageRequest.decode = function 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.essentialcontacts.v1.SendTestMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push(reader.string()); + break; + case 2: + message.resource = reader.string(); + break; + case 3: + message.notificationCategory = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SendTestMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.essentialcontacts.v1.SendTestMessageRequest} SendTestMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendTestMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SendTestMessageRequest message. + * @function verify + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SendTestMessageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contacts != null && message.hasOwnProperty("contacts")) { + if (!Array.isArray(message.contacts)) + return "contacts: array expected"; + for (var i = 0; i < message.contacts.length; ++i) + if (!$util.isString(message.contacts[i])) + return "contacts: string[] expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.notificationCategory != null && message.hasOwnProperty("notificationCategory")) + switch (message.notificationCategory) { + default: + return "notificationCategory: enum value expected"; + case 0: + case 2: + case 3: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + return null; + }; + + /** + * Creates a SendTestMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.essentialcontacts.v1.SendTestMessageRequest} SendTestMessageRequest + */ + SendTestMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.essentialcontacts.v1.SendTestMessageRequest) + return object; + var message = new $root.google.cloud.essentialcontacts.v1.SendTestMessageRequest(); + if (object.contacts) { + if (!Array.isArray(object.contacts)) + throw TypeError(".google.cloud.essentialcontacts.v1.SendTestMessageRequest.contacts: array expected"); + message.contacts = []; + for (var i = 0; i < object.contacts.length; ++i) + message.contacts[i] = String(object.contacts[i]); + } + if (object.resource != null) + message.resource = String(object.resource); + switch (object.notificationCategory) { + case "NOTIFICATION_CATEGORY_UNSPECIFIED": + case 0: + message.notificationCategory = 0; + break; + case "ALL": + case 2: + message.notificationCategory = 2; + break; + case "SUSPENSION": + case 3: + message.notificationCategory = 3; + break; + case "SECURITY": + case 5: + message.notificationCategory = 5; + break; + case "TECHNICAL": + case 6: + message.notificationCategory = 6; + break; + case "BILLING": + case 7: + message.notificationCategory = 7; + break; + case "LEGAL": + case 8: + message.notificationCategory = 8; + break; + case "PRODUCT_UPDATES": + case 9: + message.notificationCategory = 9; + break; + case "TECHNICAL_INCIDENTS": + case 10: + message.notificationCategory = 10; + break; + } + return message; + }; + + /** + * Creates a plain object from a SendTestMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @static + * @param {google.cloud.essentialcontacts.v1.SendTestMessageRequest} message SendTestMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SendTestMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contacts = []; + if (options.defaults) { + object.resource = ""; + object.notificationCategory = options.enums === String ? "NOTIFICATION_CATEGORY_UNSPECIFIED" : 0; + } + if (message.contacts && message.contacts.length) { + object.contacts = []; + for (var j = 0; j < message.contacts.length; ++j) + object.contacts[j] = message.contacts[j]; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.notificationCategory != null && message.hasOwnProperty("notificationCategory")) + object.notificationCategory = options.enums === String ? $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategory] : message.notificationCategory; + return object; + }; + + /** + * Converts this SendTestMessageRequest to JSON. + * @function toJSON + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @instance + * @returns {Object.} JSON object + */ + SendTestMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SendTestMessageRequest; + })(); + + return v1; + })(); + + return essentialcontacts; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + case 5: + message.plural = reader.string(); + break; + case 6: + message.singular = reader.string(); + break; + case 10: + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32(); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1052: + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * 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.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-essentialcontacts/protos/protos.json b/packages/google-cloud-essentialcontacts/protos/protos.json new file mode 100644 index 00000000000..1e851442579 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/protos/protos.json @@ -0,0 +1,1588 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "essentialcontacts": { + "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/essentialcontacts/v1;essentialcontacts", + "java_multiple_files": true, + "java_outer_classname": "EnumsProto", + "java_package": "com.google.cloud.essentialcontacts.v1", + "csharp_namespace": "Google.Cloud.EssentialContacts.V1", + "php_namespace": "Google\\Cloud\\EssentialContacts\\V1", + "ruby_package": "Google::Cloud::EssentialContacts::V1" + }, + "nested": { + "NotificationCategory": { + "values": { + "NOTIFICATION_CATEGORY_UNSPECIFIED": 0, + "ALL": 2, + "SUSPENSION": 3, + "SECURITY": 5, + "TECHNICAL": 6, + "BILLING": 7, + "LEGAL": 8, + "PRODUCT_UPDATES": 9, + "TECHNICAL_INCIDENTS": 10 + } + }, + "ValidationState": { + "values": { + "VALIDATION_STATE_UNSPECIFIED": 0, + "VALID": 1, + "INVALID": 2 + } + }, + "EssentialContactsService": { + "options": { + "(google.api.default_host)": "essentialcontacts.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateContact": { + "requestType": "CreateContactRequest", + "responseType": "Contact", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/contacts", + "(google.api.http).body": "contact", + "(google.api.http).additional_bindings.post": "/v1/{parent=organizations/*}/contacts", + "(google.api.http).additional_bindings.body": "contact", + "(google.api.method_signature)": "parent,contact" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/contacts", + "body": "contact", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*}/contacts", + "body": "contact" + }, + { + "post": "/v1/{parent=organizations/*}/contacts", + "body": "contact" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,contact" + } + ] + }, + "UpdateContact": { + "requestType": "UpdateContactRequest", + "responseType": "Contact", + "options": { + "(google.api.http).patch": "/v1/{contact.name=projects/*/contacts/*}", + "(google.api.http).body": "contact", + "(google.api.http).additional_bindings.patch": "/v1/{contact.name=organizations/*/contacts/*}", + "(google.api.http).additional_bindings.body": "contact", + "(google.api.method_signature)": "contact,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{contact.name=projects/*/contacts/*}", + "body": "contact", + "additional_bindings": [ + { + "patch": "/v1/{contact.name=folders/*/contacts/*}", + "body": "contact" + }, + { + "patch": "/v1/{contact.name=organizations/*/contacts/*}", + "body": "contact" + } + ] + } + }, + { + "(google.api.method_signature)": "contact,update_mask" + } + ] + }, + "ListContacts": { + "requestType": "ListContactsRequest", + "responseType": "ListContactsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/contacts", + "(google.api.http).additional_bindings.get": "/v1/{parent=organizations/*}/contacts", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/contacts", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/contacts" + }, + { + "get": "/v1/{parent=organizations/*}/contacts" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetContact": { + "requestType": "GetContactRequest", + "responseType": "Contact", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/contacts/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=organizations/*/contacts/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/contacts/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/contacts/*}" + }, + { + "get": "/v1/{name=organizations/*/contacts/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteContact": { + "requestType": "DeleteContactRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/contacts/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=organizations/*/contacts/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/contacts/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=folders/*/contacts/*}" + }, + { + "delete": "/v1/{name=organizations/*/contacts/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ComputeContacts": { + "requestType": "ComputeContactsRequest", + "responseType": "ComputeContactsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/contacts:compute", + "(google.api.http).additional_bindings.get": "/v1/{parent=organizations/*}/contacts:compute" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/contacts:compute", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*}/contacts:compute" + }, + { + "get": "/v1/{parent=organizations/*}/contacts:compute" + } + ] + } + } + ] + }, + "SendTestMessage": { + "requestType": "SendTestMessageRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*}/contacts:sendTestMessage", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=organizations/*}/contacts:sendTestMessage", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*}/contacts:sendTestMessage", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{resource=folders/*}/contacts:sendTestMessage", + "body": "*" + }, + { + "post": "/v1/{resource=organizations/*}/contacts:sendTestMessage", + "body": "*" + } + ] + } + } + ] + } + } + }, + "Contact": { + "options": { + "(google.api.resource).type": "essentialcontacts.googleapis.com/Contact", + "(google.api.resource).pattern": "organizations/{organization}/contacts/{contact}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "email": { + "type": "string", + "id": 2 + }, + "notificationCategorySubscriptions": { + "rule": "repeated", + "type": "NotificationCategory", + "id": 3 + }, + "languageTag": { + "type": "string", + "id": 4 + }, + "validationState": { + "type": "ValidationState", + "id": 8 + }, + "validateTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + } + } + }, + "ListContactsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "essentialcontacts.googleapis.com/Contact" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListContactsResponse": { + "fields": { + "contacts": { + "rule": "repeated", + "type": "Contact", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetContactRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "essentialcontacts.googleapis.com/Contact" + } + } + } + }, + "DeleteContactRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "essentialcontacts.googleapis.com/Contact" + } + } + } + }, + "CreateContactRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "essentialcontacts.googleapis.com/Contact" + } + }, + "contact": { + "type": "Contact", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateContactRequest": { + "fields": { + "contact": { + "type": "Contact", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ComputeContactsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "essentialcontacts.googleapis.com/Contact" + } + }, + "notificationCategories": { + "rule": "repeated", + "type": "NotificationCategory", + "id": 6 + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ComputeContactsResponse": { + "fields": { + "contacts": { + "rule": "repeated", + "type": "Contact", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SendTestMessageRequest": { + "fields": { + "contacts": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "essentialcontacts.googleapis.com/Contact" + } + }, + "resource": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "essentialcontacts.googleapis.com/Contact" + } + }, + "notificationCategory": { + "type": "NotificationCategory", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-essentialcontacts/samples/README.md b/packages/google-cloud-essentialcontacts/samples/README.md new file mode 100644 index 00000000000..f0f615d5667 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/README.md @@ -0,0 +1,50 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Essential Contacts API: Node.js Samples](https://github.com/googleapis/nodejs-essential-contacts) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-essential-contacts#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-essential-contacts/blob/master/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-essential-contacts&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-essential-contacts&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/resource-manager/docs/managing-notification-contacts/ diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json new file mode 100644 index 00000000000..60a0004305b --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-essential-contacts", + "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/essential-contacts": "0.1.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^7.1.0" + } +} diff --git a/packages/google-cloud-essentialcontacts/samples/quickstart.js b/packages/google-cloud-essentialcontacts/samples/quickstart.js new file mode 100644 index 00000000000..f4fe6e2d012 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/quickstart.js @@ -0,0 +1,48 @@ +// Licensed under the Apache License, Version 2.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(projectId) { + // [START nodejs_service_control_quickstart] + // Imports the Google Cloud client library + + // eslint-disable-next-line node/no-missing-require + const { + EssentialContactsServiceClient, + } = require('@google-cloud/essential-contacts'); + + // TODO(developer): replace with your prefered project ID and serviceName. + // const projectId = 'my-project' + + // Creates a client + const client = new EssentialContactsServiceClient(); + + async function listContacts() { + const [response] = await client.listContacts({ + parent: `projects/${projectId}`, + }); + console.info(response); + } + listContacts(); + // [END nodejs_service_control_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-essentialcontacts/src/index.ts b/packages/google-cloud-essentialcontacts/src/index.ts new file mode 100644 index 00000000000..2d6dd7c3959 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/src/index.ts @@ -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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const EssentialContactsServiceClient = v1.EssentialContactsServiceClient; +type EssentialContactsServiceClient = v1.EssentialContactsServiceClient; + +export {v1, EssentialContactsServiceClient}; +export default {v1, EssentialContactsServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts new file mode 100644 index 00000000000..e69a9365355 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts @@ -0,0 +1,1440 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/essential_contacts_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './essential_contacts_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Manages contacts for important Google Cloud notifications. + * @class + * @memberof v1 + */ +export class EssentialContactsServiceClient { + 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}; + essentialContactsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of EssentialContactsServiceClient. + * + * @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 EssentialContactsServiceClient; + 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}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + folderContactPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/contacts/{contact}' + ), + organizationContactPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/contacts/{contact}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectContactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/contacts/{contact}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listContacts: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'contacts' + ), + computeContacts: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'contacts' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.essentialcontacts.v1.EssentialContactsService', + 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.essentialContactsServiceStub) { + return this.essentialContactsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.essentialcontacts.v1.EssentialContactsService. + this.essentialContactsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.essentialcontacts.v1.EssentialContactsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.essentialcontacts.v1 + .EssentialContactsService, + 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 essentialContactsServiceStubMethods = [ + 'createContact', + 'updateContact', + 'listContacts', + 'getContact', + 'deleteContact', + 'computeContacts', + 'sendTestMessage', + ]; + for (const methodName of essentialContactsServiceStubMethods) { + const callPromise = this.essentialContactsServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.essentialContactsServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'essentialcontacts.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 'essentialcontacts.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 -- + // ------------------- + createContact( + request: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact, + ( + | protos.google.cloud.essentialcontacts.v1.ICreateContactRequest + | undefined + ), + {} | undefined + ] + >; + createContact( + request: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.ICreateContactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createContact( + request: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, + callback: Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.ICreateContactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds a new contact for a resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource to save this contact for. + * Format: organizations/{organization_id}, folders/{folder_id} or + * projects/{project_id} + * @param {google.cloud.essentialcontacts.v1.Contact} request.contact + * Required. The contact to create. Must specify an email address and language + * tag. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. + * 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.createContact(request); + */ + createContact( + request: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.ICreateContactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.ICreateContactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact, + ( + | protos.google.cloud.essentialcontacts.v1.ICreateContactRequest + | 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.createContact(request, options, callback); + } + updateContact( + request: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact, + ( + | protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest + | undefined + ), + {} | undefined + ] + >; + updateContact( + request: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateContact( + request: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, + callback: Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a contact. + * Note: A contact's email address cannot be changed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.essentialcontacts.v1.Contact} request.contact + * Required. The contact resource to replace the existing saved contact. Note: + * the email address of the contact cannot be modified. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The update mask applied to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. + * 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.updateContact(request); + */ + updateContact( + request: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact, + ( + | protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest + | 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({ + 'contact.name': request.contact!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateContact(request, options, callback); + } + getContact( + request: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact, + protos.google.cloud.essentialcontacts.v1.IGetContactRequest | undefined, + {} | undefined + ] + >; + getContact( + request: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.IGetContactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getContact( + request: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, + callback: Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.IGetContactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets a single contact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the contact to retrieve. + * Format: organizations/{organization_id}/contacts/{contact_id}, + * folders/{folder_id}/contacts/{contact_id} or + * projects/{project_id}/contacts/{contact_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. + * 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.getContact(request); + */ + getContact( + request: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.IGetContactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.essentialcontacts.v1.IContact, + | protos.google.cloud.essentialcontacts.v1.IGetContactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact, + protos.google.cloud.essentialcontacts.v1.IGetContactRequest | 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.getContact(request, options, callback); + } + deleteContact( + request: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest + | undefined + ), + {} | undefined + ] + >; + deleteContact( + request: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteContact( + request: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a contact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the contact to delete. + * Format: organizations/{organization_id}/contacts/{contact_id}, + * folders/{folder_id}/contacts/{contact_id} or + * projects/{project_id}/contacts/{contact_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteContact(request); + */ + deleteContact( + request: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest + | 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.deleteContact(request, options, callback); + } + sendTestMessage( + request: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest + | undefined + ), + {} | undefined + ] + >; + sendTestMessage( + request: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + sendTestMessage( + request: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Allows a contact admin to send a test message to contact to verify that it + * has been configured correctly. + * + * @param {Object} request + * The request object that will be sent. + * @param {string[]} request.contacts + * Required. The list of names of the contacts to send a test message to. + * Format: organizations/{organization_id}/contacts/{contact_id}, + * folders/{folder_id}/contacts/{contact_id} or + * projects/{project_id}/contacts/{contact_id} + * @param {string} request.resource + * Required. The name of the resource to send the test message for. All + * contacts must either be set directly on this resource or inherited from + * another resource that is an ancestor of this one. Format: + * organizations/{organization_id}, folders/{folder_id} or + * projects/{project_id} + * @param {google.cloud.essentialcontacts.v1.NotificationCategory} request.notificationCategory + * Required. The notification category to send the test message for. All + * contacts must be subscribed to this category. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.sendTestMessage(request); + */ + sendTestMessage( + request: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.sendTestMessage(request, options, callback); + } + + listContacts( + request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact[], + protos.google.cloud.essentialcontacts.v1.IListContactsRequest | null, + protos.google.cloud.essentialcontacts.v1.IListContactsResponse + ] + >; + listContacts( + request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IListContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + > + ): void; + listContacts( + request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + callback: PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IListContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + > + ): void; + /** + * Lists the contacts that have been set on a resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * Format: organizations/{organization_id}, folders/{folder_id} or + * projects/{project_id} + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `next_page_token` in the + * response indicates that more results might be available. + * If not specified, the default page_size is 100. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listContactsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listContacts( + request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IListContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + >, + callback?: PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IListContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + > + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact[], + protos.google.cloud.essentialcontacts.v1.IListContactsRequest | null, + protos.google.cloud.essentialcontacts.v1.IListContactsResponse + ] + > | 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.listContacts(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * Format: organizations/{organization_id}, folders/{folder_id} or + * projects/{project_id} + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `next_page_token` in the + * response indicates that more results might be available. + * If not specified, the default page_size is 100. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Contact]{@link google.cloud.essentialcontacts.v1.Contact} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listContactsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listContactsStream( + request?: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listContacts.createStream( + this.innerApiCalls.listContacts as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listContacts`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * Format: organizations/{organization_id}, folders/{folder_id} or + * projects/{project_id} + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `next_page_token` in the + * response indicates that more results might be available. + * If not specified, the default page_size is 100. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listContactsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listContactsAsync( + request?: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listContacts.asyncIterate( + this.innerApiCalls['listContacts'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + computeContacts( + request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact[], + protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest | null, + protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse + ] + >; + computeContacts( + request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + > + ): void; + computeContacts( + request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + callback: PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + > + ): void; + /** + * Lists all contacts for the resource that are subscribed to the + * specified notification categories, including contacts inherited from + * any parent resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the resource to compute contacts for. + * Format: organizations/{organization_id}, + * folders/{folder_id} or projects/{project_id} + * @param {number[]} request.notificationCategories + * The categories of notifications to compute contacts for. If ALL is included + * in this list, contacts subscribed to any notification category will be + * returned. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `next_page_token` in the + * response indicates that more results might be available. + * If not specified, the default page_size is 100. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `computeContactsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + computeContacts( + request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + >, + callback?: PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + > + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact[], + protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest | null, + protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse + ] + > | 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.computeContacts(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the resource to compute contacts for. + * Format: organizations/{organization_id}, + * folders/{folder_id} or projects/{project_id} + * @param {number[]} request.notificationCategories + * The categories of notifications to compute contacts for. If ALL is included + * in this list, contacts subscribed to any notification category will be + * returned. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `next_page_token` in the + * response indicates that more results might be available. + * If not specified, the default page_size is 100. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Contact]{@link google.cloud.essentialcontacts.v1.Contact} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `computeContactsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + computeContactsStream( + request?: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.computeContacts.createStream( + this.innerApiCalls.computeContacts as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `computeContacts`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the resource to compute contacts for. + * Format: organizations/{organization_id}, + * folders/{folder_id} or projects/{project_id} + * @param {number[]} request.notificationCategories + * The categories of notifications to compute contacts for. If ALL is included + * in this list, contacts subscribed to any notification category will be + * returned. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `next_page_token` in the + * response indicates that more results might be available. + * If not specified, the default page_size is 100. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.computeContactsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + computeContactsAsync( + request?: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.computeContacts.asyncIterate( + this.innerApiCalls['computeContacts'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderContact resource name string. + * + * @param {string} folder + * @param {string} contact + * @returns {string} Resource name string. + */ + folderContactPath(folder: string, contact: string) { + return this.pathTemplates.folderContactPathTemplate.render({ + folder: folder, + contact: contact, + }); + } + + /** + * Parse the folder from FolderContact resource. + * + * @param {string} folderContactName + * A fully-qualified path representing folder_contact resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderContactName(folderContactName: string) { + return this.pathTemplates.folderContactPathTemplate.match(folderContactName) + .folder; + } + + /** + * Parse the contact from FolderContact resource. + * + * @param {string} folderContactName + * A fully-qualified path representing folder_contact resource. + * @returns {string} A string representing the contact. + */ + matchContactFromFolderContactName(folderContactName: string) { + return this.pathTemplates.folderContactPathTemplate.match(folderContactName) + .contact; + } + + /** + * Return a fully-qualified organizationContact resource name string. + * + * @param {string} organization + * @param {string} contact + * @returns {string} Resource name string. + */ + organizationContactPath(organization: string, contact: string) { + return this.pathTemplates.organizationContactPathTemplate.render({ + organization: organization, + contact: contact, + }); + } + + /** + * Parse the organization from OrganizationContact resource. + * + * @param {string} organizationContactName + * A fully-qualified path representing organization_contact resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationContactName( + organizationContactName: string + ) { + return this.pathTemplates.organizationContactPathTemplate.match( + organizationContactName + ).organization; + } + + /** + * Parse the contact from OrganizationContact resource. + * + * @param {string} organizationContactName + * A fully-qualified path representing organization_contact resource. + * @returns {string} A string representing the contact. + */ + matchContactFromOrganizationContactName(organizationContactName: string) { + return this.pathTemplates.organizationContactPathTemplate.match( + organizationContactName + ).contact; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectContact resource name string. + * + * @param {string} project + * @param {string} contact + * @returns {string} Resource name string. + */ + projectContactPath(project: string, contact: string) { + return this.pathTemplates.projectContactPathTemplate.render({ + project: project, + contact: contact, + }); + } + + /** + * Parse the project from ProjectContact resource. + * + * @param {string} projectContactName + * A fully-qualified path representing project_contact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectContactName(projectContactName: string) { + return this.pathTemplates.projectContactPathTemplate.match( + projectContactName + ).project; + } + + /** + * Parse the contact from ProjectContact resource. + * + * @param {string} projectContactName + * A fully-qualified path representing project_contact resource. + * @returns {string} A string representing the contact. + */ + matchContactFromProjectContactName(projectContactName: string) { + return this.pathTemplates.projectContactPathTemplate.match( + projectContactName + ).contact; + } + + /** + * 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.essentialContactsServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client_config.json b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client_config.json new file mode 100644 index 00000000000..bc7cfc38f87 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client_config.json @@ -0,0 +1,73 @@ +{ + "interfaces": { + "google.cloud.essentialcontacts.v1.EssentialContactsService": { + "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": { + "CreateContact": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateContact": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListContacts": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetContact": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteContact": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ComputeContacts": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SendTestMessage": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_proto_list.json b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_proto_list.json new file mode 100644 index 00000000000..05ca22d1495 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/essentialcontacts/v1/enums.proto", + "../../protos/google/cloud/essentialcontacts/v1/service.proto" +] diff --git a/packages/google-cloud-essentialcontacts/src/v1/gapic_metadata.json b/packages/google-cloud-essentialcontacts/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..31aaae2cead --- /dev/null +++ b/packages/google-cloud-essentialcontacts/src/v1/gapic_metadata.json @@ -0,0 +1,101 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.essentialcontacts.v1", + "libraryPackage": "@google-cloud/essentialcontacts", + "services": { + "EssentialContactsService": { + "clients": { + "grpc": { + "libraryClient": "EssentialContactsServiceClient", + "rpcs": { + "CreateContact": { + "methods": [ + "createContact" + ] + }, + "UpdateContact": { + "methods": [ + "updateContact" + ] + }, + "GetContact": { + "methods": [ + "getContact" + ] + }, + "DeleteContact": { + "methods": [ + "deleteContact" + ] + }, + "SendTestMessage": { + "methods": [ + "sendTestMessage" + ] + }, + "ListContacts": { + "methods": [ + "listContacts", + "listContactsStream", + "listContactsAsync" + ] + }, + "ComputeContacts": { + "methods": [ + "computeContacts", + "computeContactsStream", + "computeContactsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EssentialContactsServiceClient", + "rpcs": { + "CreateContact": { + "methods": [ + "createContact" + ] + }, + "UpdateContact": { + "methods": [ + "updateContact" + ] + }, + "GetContact": { + "methods": [ + "getContact" + ] + }, + "DeleteContact": { + "methods": [ + "deleteContact" + ] + }, + "SendTestMessage": { + "methods": [ + "sendTestMessage" + ] + }, + "ListContacts": { + "methods": [ + "listContacts", + "listContactsStream", + "listContactsAsync" + ] + }, + "ComputeContacts": { + "methods": [ + "computeContacts", + "computeContactsStream", + "computeContactsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-essentialcontacts/src/v1/index.ts b/packages/google-cloud-essentialcontacts/src/v1/index.ts new file mode 100644 index 00000000000..38dd766c250 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {EssentialContactsServiceClient} from './essential_contacts_service_client'; diff --git a/packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.js b/packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..0ddd63c155f --- /dev/null +++ b/packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const essentialcontacts = require('@google-cloud/essential-contacts'); + +function main() { + const essentialContactsServiceClient = + new essentialcontacts.EssentialContactsServiceClient(); +} + +main(); diff --git a/packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..06957029538 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,34 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {EssentialContactsServiceClient} from '@google-cloud/essential-contacts'; + +// check that the client class type name can be used +function doStuffWithEssentialContactsServiceClient( + client: EssentialContactsServiceClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const essentialContactsServiceClient = new EssentialContactsServiceClient(); + doStuffWithEssentialContactsServiceClient(essentialContactsServiceClient); +} + +main(); diff --git a/packages/google-cloud-essentialcontacts/system-test/install.ts b/packages/google-cloud-essentialcontacts/system-test/install.ts new file mode 100644 index 00000000000..d2d61c0396f --- /dev/null +++ b/packages/google-cloud-essentialcontacts/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts new file mode 100644 index 00000000000..56f1e8ead53 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts @@ -0,0 +1,1618 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as essentialcontactsserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.EssentialContactsServiceClient', () => { + it('has servicePath', () => { + const servicePath = + essentialcontactsserviceModule.v1.EssentialContactsServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + essentialcontactsserviceModule.v1.EssentialContactsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + essentialcontactsserviceModule.v1.EssentialContactsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.essentialContactsServiceStub, undefined); + await client.initialize(); + assert(client.essentialContactsServiceStub); + }); + + it('has close method', () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + 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 essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + 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('createContact', () => { + it('invokes createContact without error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ); + client.innerApiCalls.createContact = stubSimpleCall(expectedResponse); + const [response] = await client.createContact(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createContact without error using callback', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ); + client.innerApiCalls.createContact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createContact( + request, + ( + err?: Error | null, + result?: protos.google.cloud.essentialcontacts.v1.IContact | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createContact with error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createContact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createContact(request), expectedError); + assert( + (client.innerApiCalls.createContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateContact', () => { + it('invokes updateContact without error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() + ); + request.contact = {}; + request.contact.name = ''; + const expectedHeaderRequestParams = 'contact.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ); + client.innerApiCalls.updateContact = stubSimpleCall(expectedResponse); + const [response] = await client.updateContact(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateContact without error using callback', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() + ); + request.contact = {}; + request.contact.name = ''; + const expectedHeaderRequestParams = 'contact.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ); + client.innerApiCalls.updateContact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateContact( + request, + ( + err?: Error | null, + result?: protos.google.cloud.essentialcontacts.v1.IContact | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateContact with error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() + ); + request.contact = {}; + request.contact.name = ''; + const expectedHeaderRequestParams = 'contact.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateContact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateContact(request), expectedError); + assert( + (client.innerApiCalls.updateContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getContact', () => { + it('invokes getContact without error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.GetContactRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ); + client.innerApiCalls.getContact = stubSimpleCall(expectedResponse); + const [response] = await client.getContact(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getContact without error using callback', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.GetContactRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ); + client.innerApiCalls.getContact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getContact( + request, + ( + err?: Error | null, + result?: protos.google.cloud.essentialcontacts.v1.IContact | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getContact with error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.GetContactRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getContact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getContact(request), expectedError); + assert( + (client.innerApiCalls.getContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteContact', () => { + it('invokes deleteContact without error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteContact = stubSimpleCall(expectedResponse); + const [response] = await client.deleteContact(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteContact without error using callback', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteContact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteContact( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteContact with error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteContact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteContact(request), expectedError); + assert( + (client.innerApiCalls.deleteContact as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('sendTestMessage', () => { + it('invokes sendTestMessage without error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.sendTestMessage = stubSimpleCall(expectedResponse); + const [response] = await client.sendTestMessage(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.sendTestMessage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes sendTestMessage without error using callback', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.sendTestMessage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.sendTestMessage( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.sendTestMessage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes sendTestMessage with error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.sendTestMessage = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.sendTestMessage(request), expectedError); + assert( + (client.innerApiCalls.sendTestMessage as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listContacts', () => { + it('invokes listContacts without error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + ]; + client.innerApiCalls.listContacts = stubSimpleCall(expectedResponse); + const [response] = await client.listContacts(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listContacts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listContacts without error using callback', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + ]; + client.innerApiCalls.listContacts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listContacts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.essentialcontacts.v1.IContact[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listContacts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listContacts with error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listContacts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listContacts(request), expectedError); + assert( + (client.innerApiCalls.listContacts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listContactsStream without error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + ]; + client.descriptors.page.listContacts.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listContactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.essentialcontacts.v1.Contact[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.essentialcontacts.v1.Contact) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listContacts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listContacts, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listContacts.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listContactsStream with error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listContacts.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listContactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.essentialcontacts.v1.Contact[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.essentialcontacts.v1.Contact) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listContacts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listContacts, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listContacts.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listContacts without error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + ]; + client.descriptors.page.listContacts.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.essentialcontacts.v1.IContact[] = []; + const iterable = client.listContactsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listContacts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listContacts.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listContacts with error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listContacts.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listContactsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.essentialcontacts.v1.IContact[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listContacts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listContacts.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('computeContacts', () => { + it('invokes computeContacts without error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + ]; + client.innerApiCalls.computeContacts = stubSimpleCall(expectedResponse); + const [response] = await client.computeContacts(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.computeContacts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes computeContacts without error using callback', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + ]; + client.innerApiCalls.computeContacts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.computeContacts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.essentialcontacts.v1.IContact[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.computeContacts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes computeContacts with error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.computeContacts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.computeContacts(request), expectedError); + assert( + (client.innerApiCalls.computeContacts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes computeContactsStream without error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + ]; + client.descriptors.page.computeContacts.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.computeContactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.essentialcontacts.v1.Contact[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.essentialcontacts.v1.Contact) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.computeContacts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.computeContacts, request) + ); + assert.strictEqual( + ( + client.descriptors.page.computeContacts.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes computeContactsStream with error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.computeContacts.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.computeContactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.essentialcontacts.v1.Contact[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.essentialcontacts.v1.Contact) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.computeContacts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.computeContacts, request) + ); + assert.strictEqual( + ( + client.descriptors.page.computeContacts.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with computeContacts without error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.Contact() + ), + ]; + client.descriptors.page.computeContacts.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.essentialcontacts.v1.IContact[] = []; + const iterable = client.computeContactsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.computeContacts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.computeContacts.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with computeContacts with error', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.computeContacts.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.computeContactsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.essentialcontacts.v1.IContact[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.computeContacts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.computeContacts.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('folderContact', () => { + const fakePath = '/rendered/path/folderContact'; + const expectedParameters = { + folder: 'folderValue', + contact: 'contactValue', + }; + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderContactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderContactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderContactPath', () => { + const result = client.folderContactPath('folderValue', 'contactValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderContactPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderContactName', () => { + const result = client.matchFolderFromFolderContactName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderContactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContactFromFolderContactName', () => { + const result = client.matchContactFromFolderContactName(fakePath); + assert.strictEqual(result, 'contactValue'); + assert( + (client.pathTemplates.folderContactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationContact', () => { + const fakePath = '/rendered/path/organizationContact'; + const expectedParameters = { + organization: 'organizationValue', + contact: 'contactValue', + }; + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationContactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationContactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationContactPath', () => { + const result = client.organizationContactPath( + 'organizationValue', + 'contactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationContactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationContactName', () => { + const result = + client.matchOrganizationFromOrganizationContactName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationContactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContactFromOrganizationContactName', () => { + const result = client.matchContactFromOrganizationContactName(fakePath); + assert.strictEqual(result, 'contactValue'); + assert( + ( + client.pathTemplates.organizationContactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectContact', () => { + const fakePath = '/rendered/path/projectContact'; + const expectedParameters = { + project: 'projectValue', + contact: 'contactValue', + }; + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectContactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectContactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectContactPath', () => { + const result = client.projectContactPath( + 'projectValue', + 'contactValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectContactPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectContactName', () => { + const result = client.matchProjectFromProjectContactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectContactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContactFromProjectContactName', () => { + const result = client.matchContactFromProjectContactName(fakePath); + assert.strictEqual(result, 'contactValue'); + assert( + (client.pathTemplates.projectContactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-essentialcontacts/tsconfig.json b/packages/google-cloud-essentialcontacts/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-essentialcontacts/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-essentialcontacts/webpack.config.js b/packages/google-cloud-essentialcontacts/webpack.config.js new file mode 100644 index 00000000000..08ee1d0c0a4 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'EssentialContactsService', + filename: './essential-contacts-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 7dda568c4503d5b91c18218191ed944fdd1575da Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Jun 2021 11:52:52 -0700 Subject: [PATCH 05/69] chore: release 1.0.0 (#5) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-essentialcontacts/CHANGELOG.md | 8 ++++++++ packages/google-cloud-essentialcontacts/package.json | 2 +- .../google-cloud-essentialcontacts/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-essentialcontacts/CHANGELOG.md diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md new file mode 100644 index 00000000000..2ecba6bd159 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 1.0.0 (2021-06-01) + + +### Features + +* initial generation of tests and samples ([#2](https://www.github.com/googleapis/nodejs-essential-contacts/issues/2)) ([5649308](https://www.github.com/googleapis/nodejs-essential-contacts/commit/56493085095b7801dc0091665b1da830fb580040)) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index bafdd47e97c..9d6ccc94786 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "0.1.0", + "version": "1.0.0", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 60a0004305b..762b519a068 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "0.1.0" + "@google-cloud/essential-contacts": "^1.0.0" }, "devDependencies": { "c8": "^7.1.0", From 7d08374393140e0238ed2664adb4fda06573076a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 6 Jun 2021 21:11:46 +0200 Subject: [PATCH 06/69] chore(deps): update dependency mocha to v8 (#6) --- packages/google-cloud-essentialcontacts/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 762b519a068..60b8e03275b 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/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 69263006bcecb4d4468fea63a84d6e4c49788cbe Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Jun 2021 20:39:31 +0200 Subject: [PATCH 07/69] Update dependency sinon to v11 (#7) --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 9d6ccc94786..35a89e4d5f6 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -54,7 +54,7 @@ "mocha": "^8.4.0", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^10.0.0", + "sinon": "^11.0.0", "ts-loader": "^9.1.2", "typescript": "^4.2.4", "webpack": "^5.36.2", From 74057d7f60bdfcfdcb2d3d77dd0787803b63cc6d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 10 Jun 2021 18:50:10 +0000 Subject: [PATCH 08/69] fix: GoogleAdsError missing using generator version after 1.3.0 (#3) [PR](https://github.com/googleapis/gapic-generator-typescript/pull/878) within updated gapic-generator-typescript version 1.4.0 Committer: @summer-ji-eng PiperOrigin-RevId: 375759421 Source-Link: https://github.com/googleapis/googleapis/commit/95fa72fdd0d69b02d72c33b37d1e4cc66d4b1446 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f40a34377ad488a7c2bc3992b3c8d5faf5a15c46 --- packages/google-cloud-essentialcontacts/linkinator.config.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/linkinator.config.json b/packages/google-cloud-essentialcontacts/linkinator.config.json index 2273933dc80..29a223b6db6 100644 --- a/packages/google-cloud-essentialcontacts/linkinator.config.json +++ b/packages/google-cloud-essentialcontacts/linkinator.config.json @@ -1,9 +1,6 @@ { "recurse": true, "skip": [ - "https://github.com/googleapis/nodejs-essential-contacts/blob/master/samples/quickstart.js", - "https://github.com/googleapis/nodejs-essential-contacts/blob/master/CHANGELOG.md", - "https://github.com/googleapis/nodejs-essential-contacts/tree/master/samples", "https://codecov.io/gh/googleapis/", "www.googleapis.com", "img.shields.io" From 57ae6a68d06c2f0d65b7c8f763ab01510e2c1d0f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 10 Jun 2021 18:56:09 +0000 Subject: [PATCH 09/69] chore: release 1.0.1 (#13) :robot: I have created a release \*beep\* \*boop\* --- ### [1.0.1](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.0...v1.0.1) (2021-06-10) ### Bug Fixes * GoogleAdsError missing using generator version after 1.3.0 ([#3](https://www.github.com/googleapis/nodejs-essential-contacts/issues/3)) ([9a52efb](https://www.github.com/googleapis/nodejs-essential-contacts/commit/9a52efb8e21da5407123bc03b9501db42d5b8071)) --- 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-essentialcontacts/CHANGELOG.md | 7 +++++++ packages/google-cloud-essentialcontacts/package.json | 2 +- .../google-cloud-essentialcontacts/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index 2ecba6bd159..a1e49b97e8c 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.1](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.0...v1.0.1) (2021-06-10) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#3](https://www.github.com/googleapis/nodejs-essential-contacts/issues/3)) ([9a52efb](https://www.github.com/googleapis/nodejs-essential-contacts/commit/9a52efb8e21da5407123bc03b9501db42d5b8071)) + ## 1.0.0 (2021-06-01) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 35a89e4d5f6..169dcb6ac70 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "1.0.0", + "version": "1.0.1", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 60b8e03275b..52654139155 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "^1.0.0" + "@google-cloud/essential-contacts": "^1.0.1" }, "devDependencies": { "c8": "^7.1.0", From 7dca7736dc6f2d2f038205e6e27039cb2536b38a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 14 Jun 2021 21:16:09 +0000 Subject: [PATCH 10/69] build: edit package name to match published version (#16) PiperOrigin-RevId: 378706357 Source-Link: https://github.com/googleapis/googleapis/commit/526cb00f73235e79f57e1a4005fb887a4157daff Source-Link: https://github.com/googleapis/googleapis-gen/commit/2cd5d29b2a65b8bd626741d0924c84829c7463f9 --- packages/google-cloud-essentialcontacts/.jsdoc.js | 2 +- .../google-cloud-essentialcontacts/src/v1/gapic_metadata.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/.jsdoc.js b/packages/google-cloud-essentialcontacts/.jsdoc.js index 6f68d46118c..51b2f2434a0 100644 --- a/packages/google-cloud-essentialcontacts/.jsdoc.js +++ b/packages/google-cloud-essentialcontacts/.jsdoc.js @@ -52,4 +52,4 @@ module.exports = { markdown: { idInHeadings: true } -}; \ No newline at end of file +}; diff --git a/packages/google-cloud-essentialcontacts/src/v1/gapic_metadata.json b/packages/google-cloud-essentialcontacts/src/v1/gapic_metadata.json index 31aaae2cead..3c2fff716d3 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/gapic_metadata.json +++ b/packages/google-cloud-essentialcontacts/src/v1/gapic_metadata.json @@ -3,7 +3,7 @@ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "typescript", "protoPackage": "google.cloud.essentialcontacts.v1", - "libraryPackage": "@google-cloud/essentialcontacts", + "libraryPackage": "@google-cloud/essential-contacts", "services": { "EssentialContactsService": { "clients": { From ade60c53c8ff5432a221f859b5a21505d039d217 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Jun 2021 07:30:33 -0700 Subject: [PATCH 11/69] fix: make request optional in all cases (#17) Committer: @miraleung PiperOrigin-RevId: 380641501 --- .../v1/essential_contacts_service_client.ts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts index e69a9365355..71f3b5b0132 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts @@ -321,7 +321,7 @@ export class EssentialContactsServiceClient { // -- Service calls -- // ------------------- createContact( - request: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, + request?: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, options?: CallOptions ): Promise< [ @@ -377,7 +377,7 @@ export class EssentialContactsServiceClient { * const [response] = await client.createContact(request); */ createContact( - request: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, + request?: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, optionsOrCallback?: | CallOptions | Callback< @@ -423,7 +423,7 @@ export class EssentialContactsServiceClient { return this.innerApiCalls.createContact(request, options, callback); } updateContact( - request: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, + request?: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, options?: CallOptions ): Promise< [ @@ -480,7 +480,7 @@ export class EssentialContactsServiceClient { * const [response] = await client.updateContact(request); */ updateContact( - request: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, + request?: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, optionsOrCallback?: | CallOptions | Callback< @@ -526,7 +526,7 @@ export class EssentialContactsServiceClient { return this.innerApiCalls.updateContact(request, options, callback); } getContact( - request: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, + request?: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, options?: CallOptions ): Promise< [ @@ -577,7 +577,7 @@ export class EssentialContactsServiceClient { * const [response] = await client.getContact(request); */ getContact( - request: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, + request?: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, optionsOrCallback?: | CallOptions | Callback< @@ -620,7 +620,7 @@ export class EssentialContactsServiceClient { return this.innerApiCalls.getContact(request, options, callback); } deleteContact( - request: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, + request?: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, options?: CallOptions ): Promise< [ @@ -674,7 +674,7 @@ export class EssentialContactsServiceClient { * const [response] = await client.deleteContact(request); */ deleteContact( - request: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, + request?: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, optionsOrCallback?: | CallOptions | Callback< @@ -720,7 +720,7 @@ export class EssentialContactsServiceClient { return this.innerApiCalls.deleteContact(request, options, callback); } sendTestMessage( - request: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, + request?: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, options?: CallOptions ): Promise< [ @@ -784,7 +784,7 @@ export class EssentialContactsServiceClient { * const [response] = await client.sendTestMessage(request); */ sendTestMessage( - request: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, + request?: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, optionsOrCallback?: | CallOptions | Callback< @@ -831,7 +831,7 @@ export class EssentialContactsServiceClient { } listContacts( - request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + request?: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, options?: CallOptions ): Promise< [ @@ -894,7 +894,7 @@ export class EssentialContactsServiceClient { * for more details and examples. */ listContacts( - request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + request?: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -1046,7 +1046,7 @@ export class EssentialContactsServiceClient { ) as AsyncIterable; } computeContacts( - request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + request?: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, options?: CallOptions ): Promise< [ @@ -1115,7 +1115,7 @@ export class EssentialContactsServiceClient { * for more details and examples. */ computeContacts( - request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + request?: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< From 2e3dfd04704e9b3ab26eba6339d46560a7f17557 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 23 Jun 2021 14:38:09 +0000 Subject: [PATCH 12/69] chore: release 1.0.2 (#18) :robot: I have created a release \*beep\* \*boop\* --- ### [1.0.2](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.1...v1.0.2) (2021-06-23) ### Bug Fixes * make request optional in all cases ([#17](https://www.github.com/googleapis/nodejs-essential-contacts/issues/17)) ([840d58f](https://www.github.com/googleapis/nodejs-essential-contacts/commit/840d58fcc2f9eaae3122005c9da47009836d04a3)) --- 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-essentialcontacts/CHANGELOG.md | 7 +++++++ packages/google-cloud-essentialcontacts/package.json | 2 +- .../google-cloud-essentialcontacts/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index a1e49b97e8c..035441f2ef7 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.2](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.1...v1.0.2) (2021-06-23) + + +### Bug Fixes + +* make request optional in all cases ([#17](https://www.github.com/googleapis/nodejs-essential-contacts/issues/17)) ([840d58f](https://www.github.com/googleapis/nodejs-essential-contacts/commit/840d58fcc2f9eaae3122005c9da47009836d04a3)) + ### [1.0.1](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.0...v1.0.1) (2021-06-10) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 169dcb6ac70..fa9bd94d0f4 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "1.0.1", + "version": "1.0.2", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 52654139155..668cd758ef0 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "^1.0.1" + "@google-cloud/essential-contacts": "^1.0.2" }, "devDependencies": { "c8": "^7.1.0", From 28f0d164be1b93b2570b948713fdf8ed0139bc76 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 29 Jun 2021 11:27:06 -0400 Subject: [PATCH 13/69] fix(deps): google-gax v2.17.0 with mTLS (#22) --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index fa9bd94d0f4..3d44e3504e4 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^2.17.0" }, "devDependencies": { "@types/mocha": "^8.2.2", From 3c11e82c3e3d6124f163bbf253a1734c5300918f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 09:43:11 -0700 Subject: [PATCH 14/69] chore: release 1.0.3 (#23) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-essentialcontacts/CHANGELOG.md | 7 +++++++ packages/google-cloud-essentialcontacts/package.json | 2 +- .../google-cloud-essentialcontacts/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index 035441f2ef7..e12e19b8270 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.3](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.2...v1.0.3) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#22](https://www.github.com/googleapis/nodejs-essential-contacts/issues/22)) ([144d0a1](https://www.github.com/googleapis/nodejs-essential-contacts/commit/144d0a1224adb7ffe6efcde45a48d9b751611b01)) + ### [1.0.2](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.1...v1.0.2) (2021-06-23) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 3d44e3504e4..4a3fe023579 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "1.0.2", + "version": "1.0.3", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 668cd758ef0..08c191aa166 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "^1.0.2" + "@google-cloud/essential-contacts": "^1.0.3" }, "devDependencies": { "c8": "^7.1.0", From 08e6e37ec6bb341c9bfe975430ceb278cdfd573e Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 17:48:33 -0400 Subject: [PATCH 15/69] fix(deps): google-gax v2.17.1 (#26) --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 4a3fe023579..266a918d4f9 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.17.0" + "google-gax": "^2.17.1" }, "devDependencies": { "@types/mocha": "^8.2.2", From cb0e70b11046e91d3cdaa8b3e73aedb509bd2c60 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 13 Jul 2021 15:38:21 -0700 Subject: [PATCH 16/69] chore: release 1.0.4 (#27) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-essentialcontacts/CHANGELOG.md | 7 +++++++ packages/google-cloud-essentialcontacts/package.json | 2 +- .../google-cloud-essentialcontacts/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index e12e19b8270..a9bf0237688 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.4](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.3...v1.0.4) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#26](https://www.github.com/googleapis/nodejs-essential-contacts/issues/26)) ([7c8d854](https://www.github.com/googleapis/nodejs-essential-contacts/commit/7c8d854efb7d0a04efbe6efdd62a5ca5f89d70e5)) + ### [1.0.3](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.2...v1.0.3) (2021-06-29) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 266a918d4f9..f27c4b79465 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "1.0.3", + "version": "1.0.4", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 08c191aa166..96af836f8bd 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "^1.0.3" + "@google-cloud/essential-contacts": "^1.0.4" }, "devDependencies": { "c8": "^7.1.0", From 0fda2580febe1ab923f82974ca275e277d4c5cd2 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 12:05:15 -0700 Subject: [PATCH 17/69] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#28) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Updating WORKSPACE files to use the newest version of the Typescript generator. 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 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../src/v1/essential_contacts_service_client.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts index 71f3b5b0132..eb141a36623 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class EssentialContactsServiceClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class EssentialContactsServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; essentialContactsServiceStub?: Promise<{[name: string]: Function}>; @@ -103,6 +105,9 @@ export class EssentialContactsServiceClient { .constructor as typeof EssentialContactsServiceClient; 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 = @@ -196,6 +201,9 @@ export class EssentialContactsServiceClient { // 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; } /** @@ -225,7 +233,8 @@ export class EssentialContactsServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.essentialcontacts.v1 .EssentialContactsService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From 095f96cf8790e1649cf2754705105588598988b3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 13:03:50 -0700 Subject: [PATCH 18/69] chore: release 1.0.5 (#29) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-essentialcontacts/CHANGELOG.md | 7 +++++++ packages/google-cloud-essentialcontacts/package.json | 2 +- .../google-cloud-essentialcontacts/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index a9bf0237688..57ec84a9f7a 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.5](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.4...v1.0.5) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#28](https://www.github.com/googleapis/nodejs-essential-contacts/issues/28)) ([0f07b63](https://www.github.com/googleapis/nodejs-essential-contacts/commit/0f07b63f26176f1b6b4315443cfa1cddeb5cf6cd)) + ### [1.0.4](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.3...v1.0.4) (2021-07-12) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index f27c4b79465..4f13e34e107 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "1.0.4", + "version": "1.0.5", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 96af836f8bd..2b64df4ee35 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "^1.0.4" + "@google-cloud/essential-contacts": "^1.0.5" }, "devDependencies": { "c8": "^7.1.0", From 2dfeb01ecd82330baffa7020f635769134af2e4a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 20:08:14 +0000 Subject: [PATCH 19/69] chore: release 1.0.5 (#30) :robot: I have created a release \*beep\* \*boop\* --- ### [1.0.5](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.4...v1.0.5) (2021-07-16) ### Bug Fixes * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#28](https://www.github.com/googleapis/nodejs-essential-contacts/issues/28)) ([0f07b63](https://www.github.com/googleapis/nodejs-essential-contacts/commit/0f07b63f26176f1b6b4315443cfa1cddeb5cf6cd)) --- 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-essentialcontacts/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index 57ec84a9f7a..82b9b15bd4b 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -3,6 +3,13 @@ ### [1.0.5](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.4...v1.0.5) (2021-07-16) +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#28](https://www.github.com/googleapis/nodejs-essential-contacts/issues/28)) ([0f07b63](https://www.github.com/googleapis/nodejs-essential-contacts/commit/0f07b63f26176f1b6b4315443cfa1cddeb5cf6cd)) + +### [1.0.5](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.4...v1.0.5) (2021-07-16) + + ### Bug Fixes * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#28](https://www.github.com/googleapis/nodejs-essential-contacts/issues/28)) ([0f07b63](https://www.github.com/googleapis/nodejs-essential-contacts/commit/0f07b63f26176f1b6b4315443cfa1cddeb5cf6cd)) From 01eed977fd2a713914fe411508fedd81f2f7883c Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:01:03 -0400 Subject: [PATCH 20/69] chore(nodejs): update client ref docs link in metadata (#36) --- packages/google-cloud-essentialcontacts/.repo-metadata.json | 2 +- packages/google-cloud-essentialcontacts/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/.repo-metadata.json b/packages/google-cloud-essentialcontacts/.repo-metadata.json index 47333d9bc8c..570ff5e36c9 100644 --- a/packages/google-cloud-essentialcontacts/.repo-metadata.json +++ b/packages/google-cloud-essentialcontacts/.repo-metadata.json @@ -1,5 +1,5 @@ { - "client_documentation": "https://cloud.google.com/resource-manager/docs/reference/essentialcontacts/rest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/essential-contacts/latest", "product_documentation": "https://cloud.google.com/resource-manager/docs/managing-notification-contacts/", "name": "essentialcontacts", "requires_billing": true, diff --git a/packages/google-cloud-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index 36c3efaaa5e..febb88e871a 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -151,7 +151,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-essential-contacts/blob/master/LICENSE) -[client-docs]: https://cloud.google.com/resource-manager/docs/reference/essentialcontacts/rest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/essential-contacts/latest [product-docs]: https://cloud.google.com/resource-manager/docs/managing-notification-contacts/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 314238b6490b87024e0774f99e91eb38cc131cf6 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 19 Aug 2021 12:21:45 -0700 Subject: [PATCH 21/69] fix(build): migrate to using main branch (#38) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(build): migrate to using main branch * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-essentialcontacts/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index febb88e871a..e4e3999525f 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -142,8 +142,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 58f56924b51bb3b0a9f929de853bed7d80fe0859 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 19 Aug 2021 15:28:13 -0400 Subject: [PATCH 22/69] fix(deps): google-gax v2.24.1 (#39) --- packages/google-cloud-essentialcontacts/README.md | 12 ++++++------ packages/google-cloud-essentialcontacts/package.json | 2 +- .../google-cloud-essentialcontacts/samples/README.md | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index e4e3999525f..d41c8c9074a 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -6,7 +6,7 @@ [![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/essential-contacts.svg)](https://www.npmjs.org/package/@google-cloud/essential-contacts) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-essential-contacts/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-essential-contacts) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-essential-contacts/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-essential-contacts) @@ -15,7 +15,7 @@ Essential contacts client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-essential-contacts/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-essential-contacts/blob/main/CHANGELOG.md). * [Essential Contacts API Node.js Client API Reference][client-docs] * [Essential Contacts API Documentation][product-docs] @@ -85,11 +85,11 @@ listContacts(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-essential-contacts/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-essential-contacts/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-essential-contacts/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-essential-contacts&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-essential-contacts/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-essential-contacts&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | @@ -137,7 +137,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-essential-contacts/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-essential-contacts/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`) @@ -149,7 +149,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-essential-contacts/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-essential-contacts/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/essential-contacts/latest [product-docs]: https://cloud.google.com/resource-manager/docs/managing-notification-contacts/ diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 4f13e34e107..67cade02960 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.17.1" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^8.2.2", diff --git a/packages/google-cloud-essentialcontacts/samples/README.md b/packages/google-cloud-essentialcontacts/samples/README.md index f0f615d5667..8d254c332aa 100644 --- a/packages/google-cloud-essentialcontacts/samples/README.md +++ b/packages/google-cloud-essentialcontacts/samples/README.md @@ -31,7 +31,7 @@ Before running the samples, make sure you've followed the steps outlined in ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-essential-contacts/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-essential-contacts/blob/main/samples/quickstart.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-essential-contacts&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) From 10cdc4f7ba97981a4b27c4cde96dbc08cf1b96c0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 19 Aug 2021 19:34:13 +0000 Subject: [PATCH 23/69] chore: release 1.0.6 (#40) :robot: I have created a release \*beep\* \*boop\* --- ### [1.0.6](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.5...v1.0.6) (2021-08-19) ### Bug Fixes * **build:** migrate to using main branch ([#38](https://www.github.com/googleapis/nodejs-essential-contacts/issues/38)) ([600a78b](https://www.github.com/googleapis/nodejs-essential-contacts/commit/600a78b7cae96dbb46f450eb9438b7551b847460)) * **deps:** google-gax v2.24.1 ([#39](https://www.github.com/googleapis/nodejs-essential-contacts/issues/39)) ([8b55dd2](https://www.github.com/googleapis/nodejs-essential-contacts/commit/8b55dd2bc7ef8ecac7aa3be4441ee46b965b0867)) --- 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-essentialcontacts/CHANGELOG.md | 8 ++++++++ packages/google-cloud-essentialcontacts/package.json | 2 +- .../google-cloud-essentialcontacts/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index 82b9b15bd4b..60013a5b560 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.0.6](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.5...v1.0.6) (2021-08-19) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#38](https://www.github.com/googleapis/nodejs-essential-contacts/issues/38)) ([600a78b](https://www.github.com/googleapis/nodejs-essential-contacts/commit/600a78b7cae96dbb46f450eb9438b7551b847460)) +* **deps:** google-gax v2.24.1 ([#39](https://www.github.com/googleapis/nodejs-essential-contacts/issues/39)) ([8b55dd2](https://www.github.com/googleapis/nodejs-essential-contacts/commit/8b55dd2bc7ef8ecac7aa3be4441ee46b965b0867)) + ### [1.0.5](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.4...v1.0.5) (2021-07-16) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 67cade02960..87f26fa473c 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "1.0.5", + "version": "1.0.6", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 2b64df4ee35..a2f2b25c798 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "^1.0.5" + "@google-cloud/essential-contacts": "^1.0.6" }, "devDependencies": { "c8": "^7.1.0", From 223c35e5ef48e22362636fb98908de8860934be5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:28:42 +0000 Subject: [PATCH 24/69] feat: turns on self-signed JWT feature flag (#41) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 392067151 Source-Link: https://github.com/googleapis/googleapis/commit/06345f7b95c4b4a3ffe4303f1f2984ccc304b2e0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95882b37970e41e4cd51b22fa507cfd46dc7c4b6 --- .../src/v1/essential_contacts_service_client.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts index eb141a36623..511d505fb93 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts @@ -132,6 +132,12 @@ export class EssentialContactsServiceClient { // 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 bff3684531808648628b36712acbdb1a3e4be4ec Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:42:14 +0000 Subject: [PATCH 25/69] chore: release 1.1.0 (#42) :robot: I have created a release \*beep\* \*boop\* --- ## [1.1.0](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.6...v1.1.0) (2021-08-23) ### Features * turns on self-signed JWT feature flag ([#41](https://www.github.com/googleapis/nodejs-essential-contacts/issues/41)) ([1e65471](https://www.github.com/googleapis/nodejs-essential-contacts/commit/1e65471768b57b96bf7e669818be6f53d8e5e6fb)) --- 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-essentialcontacts/CHANGELOG.md | 7 +++++++ packages/google-cloud-essentialcontacts/package.json | 2 +- .../google-cloud-essentialcontacts/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index 60013a5b560..3f2648ea64a 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.0](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.6...v1.1.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#41](https://www.github.com/googleapis/nodejs-essential-contacts/issues/41)) ([1e65471](https://www.github.com/googleapis/nodejs-essential-contacts/commit/1e65471768b57b96bf7e669818be6f53d8e5e6fb)) + ### [1.0.6](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.5...v1.0.6) (2021-08-19) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 87f26fa473c..d3dc34d572e 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "1.0.6", + "version": "1.1.0", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index a2f2b25c798..5bde6455904 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "^1.0.6" + "@google-cloud/essential-contacts": "^1.1.0" }, "devDependencies": { "c8": "^7.1.0", From 57f254a0762b89f1790142d69e23b274d9d96ac6 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 25 Aug 2021 11:13:11 -0700 Subject: [PATCH 26/69] fix: flag module as GA (#44) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: flag module as GA * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update .repo-metadata.json * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../.repo-metadata.json | 2 +- packages/google-cloud-essentialcontacts/README.md | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/.repo-metadata.json b/packages/google-cloud-essentialcontacts/.repo-metadata.json index 570ff5e36c9..55ee4b9778a 100644 --- a/packages/google-cloud-essentialcontacts/.repo-metadata.json +++ b/packages/google-cloud-essentialcontacts/.repo-metadata.json @@ -3,7 +3,7 @@ "product_documentation": "https://cloud.google.com/resource-manager/docs/managing-notification-contacts/", "name": "essentialcontacts", "requires_billing": true, - "release_level": "beta", + "release_level": "ga", "language": "nodejs", "api_id": "essentialcontacts.googleapis.com", "distribution_name": "@google-cloud/essential-contacts", diff --git a/packages/google-cloud-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index d41c8c9074a..c265254d7a9 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -4,7 +4,7 @@ # [Essential Contacts API: Node.js Client](https://github.com/googleapis/nodejs-essential-contacts) -[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/essential-contacts.svg)](https://www.npmjs.org/package/@google-cloud/essential-contacts) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-essential-contacts/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-essential-contacts) @@ -122,11 +122,12 @@ _Legacy Node.js versions are supported as a best effort:_ This library follows [Semantic Versioning](http://semver.org/). +This library is considered to be **General Availability (GA)**. This means it +is stable; the code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **GA** libraries +are addressed with the highest priority. -This library is considered to be in **beta**. This means it is expected to be -mostly stable while we work toward a general availability release; however, -complete stability is not guaranteed. We will address issues and requests -against beta libraries with a high priority. From 88f88245e35cfabb8dd48f43608ef33df8e2dfed Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 18:18:13 +0000 Subject: [PATCH 27/69] chore: release 1.1.1 (#45) :robot: I have created a release \*beep\* \*boop\* --- ### [1.1.1](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.1.0...v1.1.1) (2021-08-25) ### Bug Fixes * flag module as GA ([#44](https://www.github.com/googleapis/nodejs-essential-contacts/issues/44)) ([8d31c91](https://www.github.com/googleapis/nodejs-essential-contacts/commit/8d31c9125ca659842795a42c3cfae41d89ff4cb9)) --- 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-essentialcontacts/CHANGELOG.md | 7 +++++++ packages/google-cloud-essentialcontacts/package.json | 2 +- .../google-cloud-essentialcontacts/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index 3f2648ea64a..6c03c1a941a 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.1.1](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.1.0...v1.1.1) (2021-08-25) + + +### Bug Fixes + +* flag module as GA ([#44](https://www.github.com/googleapis/nodejs-essential-contacts/issues/44)) ([8d31c91](https://www.github.com/googleapis/nodejs-essential-contacts/commit/8d31c9125ca659842795a42c3cfae41d89ff4cb9)) + ## [1.1.0](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.0.6...v1.1.0) (2021-08-23) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index d3dc34d572e..4e93609873f 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "1.1.0", + "version": "1.1.1", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 5bde6455904..8c965adb3a8 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "^1.1.0" + "@google-cloud/essential-contacts": "^1.1.1" }, "devDependencies": { "c8": "^7.1.0", From d8cdbb6376a5a40278cea19fb7c0be87bf5bd280 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 30 Aug 2021 17:52:03 +0200 Subject: [PATCH 28/69] chore(deps): update dependency mocha to v9 (#47) --- packages/google-cloud-essentialcontacts/package.json | 4 ++-- packages/google-cloud-essentialcontacts/samples/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 4e93609873f..437ac4200b3 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -42,7 +42,7 @@ "google-gax": "^2.24.1" }, "devDependencies": { - "@types/mocha": "^8.2.2", + "@types/mocha": "^9.0.0", "@types/node": "^14.14.44", "@types/sinon": "^10.0.0", "c8": "^7.7.2", @@ -51,7 +51,7 @@ "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.6", "linkinator": "^2.13.6", - "mocha": "^8.4.0", + "mocha": "^9.0.0", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", "sinon": "^11.0.0", diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 8c965adb3a8..4957b33b544 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -18,6 +18,6 @@ "devDependencies": { "c8": "^7.1.0", "chai": "^4.2.0", - "mocha": "^8.0.0" + "mocha": "^9.0.0" } } From 4aa16823aa23e0856945356e8fd7a60f92b09b2b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 00:48:35 +0000 Subject: [PATCH 29/69] build(node): update deps used during postprocessing (#1243) (#54) --- .../protos/protos.d.ts | 3 ++- .../protos/protos.js | 7 +++++++ .../protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/protos/protos.d.ts b/packages/google-cloud-essentialcontacts/protos/protos.d.ts index eb580418630..d51e2e898e5 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.d.ts +++ b/packages/google-cloud-essentialcontacts/protos/protos.d.ts @@ -1566,7 +1566,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-essentialcontacts/protos/protos.js b/packages/google-cloud-essentialcontacts/protos/protos.js index 2f567e6ba45..8101580d5b5 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.js +++ b/packages/google-cloud-essentialcontacts/protos/protos.js @@ -3834,6 +3834,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); @@ -3844,6 +3845,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; })(); @@ -10012,6 +10014,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -10116,6 +10119,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-essentialcontacts/protos/protos.json b/packages/google-cloud-essentialcontacts/protos/protos.json index 1e851442579..9dcf2f0a2b4 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.json +++ b/packages/google-cloud-essentialcontacts/protos/protos.json @@ -579,7 +579,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "resourceReference": { @@ -1222,6 +1223,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From 88007113ecdb32a413579e7c925fac97ce4b7155 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 27 Oct 2021 11:24:40 -0700 Subject: [PATCH 30/69] chore: fix the wrong post processor image (#56) --- packages/google-cloud-essentialcontacts/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/.github/.OwlBot.yaml b/packages/google-cloud-essentialcontacts/.github/.OwlBot.yaml index a51ada55a10..f84e2f5414d 100644 --- a/packages/google-cloud-essentialcontacts/.github/.OwlBot.yaml +++ b/packages/google-cloud-essentialcontacts/.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 926fea903ad3524fc74a09ff668c286c09d92621 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Oct 2021 20:40:28 +0200 Subject: [PATCH 31/69] chore(deps): update dependency @types/node to v16 (#55) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^14.14.44` -> `^16.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/14.17.32/16.11.6) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/compatibility-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/confidence-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-essential-contacts). --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 437ac4200b3..2d9b9e6b5ff 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^14.14.44", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.7.2", "gts": "^3.1.0", From 0a62dec4e4cc28ba3966579202bee2ebca79a84c Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 3 Nov 2021 11:42:33 -0400 Subject: [PATCH 32/69] chore(cloud-rad): delete api-extractor config (#57) --- .../api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-essentialcontacts/api-extractor.json diff --git a/packages/google-cloud-essentialcontacts/api-extractor.json b/packages/google-cloud-essentialcontacts/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-essentialcontacts/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 eb422eee15788787a425e6e11c366b0dd2f03d4e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:46:24 +0100 Subject: [PATCH 33/69] chore(deps): update dependency sinon to v12 (#58) 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-essential-contacts). --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 2d9b9e6b5ff..bc98e1b0d38 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -54,7 +54,7 @@ "mocha": "^9.0.0", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^11.0.0", + "sinon": "^12.0.0", "ts-loader": "^9.1.2", "typescript": "^4.2.4", "webpack": "^5.36.2", From 270d38f594347592a311a0c14e60ceb1af9d747f 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:28 -0800 Subject: [PATCH 34/69] docs(samples): add example tags to generated samples (#59) 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 +- ...ntial_contacts_service.compute_contacts.js | 79 ++++ ...sential_contacts_service.create_contact.js | 61 +++ ...sential_contacts_service.delete_contact.js | 56 +++ .../essential_contacts_service.get_contact.js | 56 +++ ...ssential_contacts_service.list_contacts.js | 71 ++++ ...tial_contacts_service.send_test_message.js | 71 ++++ ...sential_contacts_service.update_contact.js | 60 +++ .../v1/essential_contacts_service_client.ts | 382 +++++++++--------- 9 files changed, 644 insertions(+), 194 deletions(-) create mode 100644 packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js create mode 100644 packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js create mode 100644 packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js create mode 100644 packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js create mode 100644 packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js create mode 100644 packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js create mode 100644 packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js diff --git a/packages/google-cloud-essentialcontacts/linkinator.config.json b/packages/google-cloud-essentialcontacts/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-essentialcontacts/linkinator.config.json +++ b/packages/google-cloud-essentialcontacts/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js new file mode 100644 index 00000000000..0d0eb508d80 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js @@ -0,0 +1,79 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource to compute contacts for. + * Format: organizations/{organization_id}, + * folders/{folder_id} or projects/{project_id} + */ + // const parent = 'abc123' + /** + * The categories of notifications to compute contacts for. If ALL is included + * in this list, contacts subscribed to any notification category will be + * returned. + */ + // const notificationCategories = 1234 + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `next_page_token` in the + * response indicates that more results might be available. + * If not specified, the default page_size is 100. + */ + // const pageSize = 1234 + /** + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + */ + // const pageToken = 'abc123' + + // Imports the Essentialcontacts library + const {EssentialContactsServiceClient} = + require('@google-cloud/essential-contacts').v1; + + // Instantiates a client + const essentialcontactsClient = new EssentialContactsServiceClient(); + + async function callComputeContacts() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await essentialcontactsClient.computeContactsAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } + } + + callComputeContacts(); + // [END essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js new file mode 100644 index 00000000000..c1e18d7b689 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js @@ -0,0 +1,61 @@ +// 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, contact) { + // [START essentialcontacts_v1_generated_EssentialContactsService_CreateContact_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource to save this contact for. + * Format: organizations/{organization_id}, folders/{folder_id} or + * projects/{project_id} + */ + // const parent = 'abc123' + /** + * Required. The contact to create. Must specify an email address and language + * tag. + */ + // const contact = {} + + // Imports the Essentialcontacts library + const {EssentialContactsServiceClient} = + require('@google-cloud/essential-contacts').v1; + + // Instantiates a client + const essentialcontactsClient = new EssentialContactsServiceClient(); + + async function callCreateContact() { + // Construct request + const request = { + parent, + contact, + }; + + // Run request + const response = await essentialcontactsClient.createContact(request); + console.log(response); + } + + callCreateContact(); + // [END essentialcontacts_v1_generated_EssentialContactsService_CreateContact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js new file mode 100644 index 00000000000..1b6240271be --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the contact to delete. + * Format: organizations/{organization_id}/contacts/{contact_id}, + * folders/{folder_id}/contacts/{contact_id} or + * projects/{project_id}/contacts/{contact_id} + */ + // const name = 'abc123' + + // Imports the Essentialcontacts library + const {EssentialContactsServiceClient} = + require('@google-cloud/essential-contacts').v1; + + // Instantiates a client + const essentialcontactsClient = new EssentialContactsServiceClient(); + + async function callDeleteContact() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await essentialcontactsClient.deleteContact(request); + console.log(response); + } + + callDeleteContact(); + // [END essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js new file mode 100644 index 00000000000..93ee0d77283 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START essentialcontacts_v1_generated_EssentialContactsService_GetContact_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the contact to retrieve. + * Format: organizations/{organization_id}/contacts/{contact_id}, + * folders/{folder_id}/contacts/{contact_id} or + * projects/{project_id}/contacts/{contact_id} + */ + // const name = 'abc123' + + // Imports the Essentialcontacts library + const {EssentialContactsServiceClient} = + require('@google-cloud/essential-contacts').v1; + + // Instantiates a client + const essentialcontactsClient = new EssentialContactsServiceClient(); + + async function callGetContact() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await essentialcontactsClient.getContact(request); + console.log(response); + } + + callGetContact(); + // [END essentialcontacts_v1_generated_EssentialContactsService_GetContact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js new file mode 100644 index 00000000000..ac811a83cdf --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START essentialcontacts_v1_generated_EssentialContactsService_ListContacts_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + * Format: organizations/{organization_id}, folders/{folder_id} or + * projects/{project_id} + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of `next_page_token` in the + * response indicates that more results might be available. + * If not specified, the default page_size is 100. + */ + // const pageSize = 1234 + /** + * Optional. If present, retrieves the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + */ + // const pageToken = 'abc123' + + // Imports the Essentialcontacts library + const {EssentialContactsServiceClient} = + require('@google-cloud/essential-contacts').v1; + + // Instantiates a client + const essentialcontactsClient = new EssentialContactsServiceClient(); + + async function callListContacts() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await essentialcontactsClient.listContactsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListContacts(); + // [END essentialcontacts_v1_generated_EssentialContactsService_ListContacts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js new file mode 100644 index 00000000000..01703532992 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(contacts, resource, notificationCategory) { + // [START essentialcontacts_v1_generated_EssentialContactsService_SendTestMessage_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The list of names of the contacts to send a test message to. + * Format: organizations/{organization_id}/contacts/{contact_id}, + * folders/{folder_id}/contacts/{contact_id} or + * projects/{project_id}/contacts/{contact_id} + */ + // const contacts = 'abc123' + /** + * Required. The name of the resource to send the test message for. All + * contacts must either be set directly on this resource or inherited from + * another resource that is an ancestor of this one. Format: + * organizations/{organization_id}, folders/{folder_id} or + * projects/{project_id} + */ + // const resource = 'abc123' + /** + * Required. The notification category to send the test message for. All + * contacts must be subscribed to this category. + */ + // const notificationCategory = {} + + // Imports the Essentialcontacts library + const {EssentialContactsServiceClient} = + require('@google-cloud/essential-contacts').v1; + + // Instantiates a client + const essentialcontactsClient = new EssentialContactsServiceClient(); + + async function callSendTestMessage() { + // Construct request + const request = { + contacts, + resource, + notificationCategory, + }; + + // Run request + const response = await essentialcontactsClient.sendTestMessage(request); + console.log(response); + } + + callSendTestMessage(); + // [END essentialcontacts_v1_generated_EssentialContactsService_SendTestMessage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js new file mode 100644 index 00000000000..9983c9b10cc --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(contact) { + // [START essentialcontacts_v1_generated_EssentialContactsService_UpdateContact_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The contact resource to replace the existing saved contact. Note: + * the email address of the contact cannot be modified. + */ + // const contact = {} + /** + * Optional. The update mask applied to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Essentialcontacts library + const {EssentialContactsServiceClient} = + require('@google-cloud/essential-contacts').v1; + + // Instantiates a client + const essentialcontactsClient = new EssentialContactsServiceClient(); + + async function callUpdateContact() { + // Construct request + const request = { + contact, + }; + + // Run request + const response = await essentialcontactsClient.updateContact(request); + console.log(response); + } + + callUpdateContact(); + // [END essentialcontacts_v1_generated_EssentialContactsService_UpdateContact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts index 511d505fb93..f7f46a04998 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts @@ -335,6 +335,28 @@ export class EssentialContactsServiceClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Adds a new contact for a resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource to save this contact for. + * Format: organizations/{organization_id}, folders/{folder_id} or + * projects/{project_id} + * @param {google.cloud.essentialcontacts.v1.Contact} request.contact + * Required. The contact to create. Must specify an email address and language + * tag. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/essential_contacts_service.create_contact.js + * region_tag:essentialcontacts_v1_generated_EssentialContactsService_CreateContact_async + */ createContact( request?: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, options?: CallOptions @@ -369,28 +391,6 @@ export class EssentialContactsServiceClient { {} | null | undefined > ): void; - /** - * Adds a new contact for a resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource to save this contact for. - * Format: organizations/{organization_id}, folders/{folder_id} or - * projects/{project_id} - * @param {google.cloud.essentialcontacts.v1.Contact} request.contact - * Required. The contact to create. Must specify an email address and language - * tag. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. - * 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.createContact(request); - */ createContact( request?: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, optionsOrCallback?: @@ -437,6 +437,29 @@ export class EssentialContactsServiceClient { this.initialize(); return this.innerApiCalls.createContact(request, options, callback); } + /** + * Updates a contact. + * Note: A contact's email address cannot be changed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.essentialcontacts.v1.Contact} request.contact + * Required. The contact resource to replace the existing saved contact. Note: + * the email address of the contact cannot be modified. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The update mask applied to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/essential_contacts_service.update_contact.js + * region_tag:essentialcontacts_v1_generated_EssentialContactsService_UpdateContact_async + */ updateContact( request?: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, options?: CallOptions @@ -471,29 +494,6 @@ export class EssentialContactsServiceClient { {} | null | undefined > ): void; - /** - * Updates a contact. - * Note: A contact's email address cannot be changed. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.essentialcontacts.v1.Contact} request.contact - * Required. The contact resource to replace the existing saved contact. Note: - * the email address of the contact cannot be modified. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The update mask applied to the resource. For the `FieldMask` - * definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. - * 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.updateContact(request); - */ updateContact( request?: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, optionsOrCallback?: @@ -540,6 +540,26 @@ export class EssentialContactsServiceClient { this.initialize(); return this.innerApiCalls.updateContact(request, options, callback); } + /** + * Gets a single contact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the contact to retrieve. + * Format: organizations/{organization_id}/contacts/{contact_id}, + * folders/{folder_id}/contacts/{contact_id} or + * projects/{project_id}/contacts/{contact_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/essential_contacts_service.get_contact.js + * region_tag:essentialcontacts_v1_generated_EssentialContactsService_GetContact_async + */ getContact( request?: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, options?: CallOptions @@ -571,26 +591,6 @@ export class EssentialContactsServiceClient { {} | null | undefined > ): void; - /** - * Gets a single contact. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the contact to retrieve. - * Format: organizations/{organization_id}/contacts/{contact_id}, - * folders/{folder_id}/contacts/{contact_id} or - * projects/{project_id}/contacts/{contact_id} - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Contact]{@link google.cloud.essentialcontacts.v1.Contact}. - * 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.getContact(request); - */ getContact( request?: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, optionsOrCallback?: @@ -634,6 +634,26 @@ export class EssentialContactsServiceClient { this.initialize(); return this.innerApiCalls.getContact(request, options, callback); } + /** + * Deletes a contact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the contact to delete. + * Format: organizations/{organization_id}/contacts/{contact_id}, + * folders/{folder_id}/contacts/{contact_id} or + * projects/{project_id}/contacts/{contact_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/essential_contacts_service.delete_contact.js + * region_tag:essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_async + */ deleteContact( request?: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, options?: CallOptions @@ -668,26 +688,6 @@ export class EssentialContactsServiceClient { {} | null | undefined > ): void; - /** - * Deletes a contact. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the contact to delete. - * Format: organizations/{organization_id}/contacts/{contact_id}, - * folders/{folder_id}/contacts/{contact_id} or - * projects/{project_id}/contacts/{contact_id} - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteContact(request); - */ deleteContact( request?: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, optionsOrCallback?: @@ -734,6 +734,36 @@ export class EssentialContactsServiceClient { this.initialize(); return this.innerApiCalls.deleteContact(request, options, callback); } + /** + * Allows a contact admin to send a test message to contact to verify that it + * has been configured correctly. + * + * @param {Object} request + * The request object that will be sent. + * @param {string[]} request.contacts + * Required. The list of names of the contacts to send a test message to. + * Format: organizations/{organization_id}/contacts/{contact_id}, + * folders/{folder_id}/contacts/{contact_id} or + * projects/{project_id}/contacts/{contact_id} + * @param {string} request.resource + * Required. The name of the resource to send the test message for. All + * contacts must either be set directly on this resource or inherited from + * another resource that is an ancestor of this one. Format: + * organizations/{organization_id}, folders/{folder_id} or + * projects/{project_id} + * @param {google.cloud.essentialcontacts.v1.NotificationCategory} request.notificationCategory + * Required. The notification category to send the test message for. All + * contacts must be subscribed to this category. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/essential_contacts_service.send_test_message.js + * region_tag:essentialcontacts_v1_generated_EssentialContactsService_SendTestMessage_async + */ sendTestMessage( request?: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, options?: CallOptions @@ -768,36 +798,6 @@ export class EssentialContactsServiceClient { {} | null | undefined > ): void; - /** - * Allows a contact admin to send a test message to contact to verify that it - * has been configured correctly. - * - * @param {Object} request - * The request object that will be sent. - * @param {string[]} request.contacts - * Required. The list of names of the contacts to send a test message to. - * Format: organizations/{organization_id}/contacts/{contact_id}, - * folders/{folder_id}/contacts/{contact_id} or - * projects/{project_id}/contacts/{contact_id} - * @param {string} request.resource - * Required. The name of the resource to send the test message for. All - * contacts must either be set directly on this resource or inherited from - * another resource that is an ancestor of this one. Format: - * organizations/{organization_id}, folders/{folder_id} or - * projects/{project_id} - * @param {google.cloud.essentialcontacts.v1.NotificationCategory} request.notificationCategory - * Required. The notification category to send the test message for. All - * contacts must be subscribed to this category. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.sendTestMessage(request); - */ sendTestMessage( request?: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, optionsOrCallback?: @@ -845,37 +845,6 @@ export class EssentialContactsServiceClient { return this.innerApiCalls.sendTestMessage(request, options, callback); } - listContacts( - request?: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.essentialcontacts.v1.IContact[], - protos.google.cloud.essentialcontacts.v1.IListContactsRequest | null, - protos.google.cloud.essentialcontacts.v1.IListContactsResponse - ] - >; - listContacts( - request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.essentialcontacts.v1.IListContactsRequest, - | protos.google.cloud.essentialcontacts.v1.IListContactsResponse - | null - | undefined, - protos.google.cloud.essentialcontacts.v1.IContact - > - ): void; - listContacts( - request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, - callback: PaginationCallback< - protos.google.cloud.essentialcontacts.v1.IListContactsRequest, - | protos.google.cloud.essentialcontacts.v1.IListContactsResponse - | null - | undefined, - protos.google.cloud.essentialcontacts.v1.IContact - > - ): void; /** * Lists the contacts that have been set on a resource. * @@ -908,6 +877,37 @@ export class EssentialContactsServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listContacts( + request?: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact[], + protos.google.cloud.essentialcontacts.v1.IListContactsRequest | null, + protos.google.cloud.essentialcontacts.v1.IListContactsResponse + ] + >; + listContacts( + request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IListContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + > + ): void; + listContacts( + request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + callback: PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IListContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IListContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + > + ): void; listContacts( request?: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, optionsOrCallback?: @@ -994,7 +994,8 @@ export class EssentialContactsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listContacts']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listContacts.createStream( this.innerApiCalls.listContacts as gax.GaxCall, @@ -1033,11 +1034,8 @@ export class EssentialContactsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listContactsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/essential_contacts_service.list_contacts.js + * region_tag:essentialcontacts_v1_generated_EssentialContactsService_ListContacts_async */ listContactsAsync( request?: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, @@ -1051,8 +1049,8 @@ export class EssentialContactsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listContacts']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listContacts.asyncIterate( this.innerApiCalls['listContacts'] as GaxCall, @@ -1060,37 +1058,6 @@ export class EssentialContactsServiceClient { callSettings ) as AsyncIterable; } - computeContacts( - request?: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.essentialcontacts.v1.IContact[], - protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest | null, - protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse - ] - >; - computeContacts( - request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, - | protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse - | null - | undefined, - protos.google.cloud.essentialcontacts.v1.IContact - > - ): void; - computeContacts( - request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, - callback: PaginationCallback< - protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, - | protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse - | null - | undefined, - protos.google.cloud.essentialcontacts.v1.IContact - > - ): void; /** * Lists all contacts for the resource that are subscribed to the * specified notification categories, including contacts inherited from @@ -1129,6 +1096,37 @@ export class EssentialContactsServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + computeContacts( + request?: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.essentialcontacts.v1.IContact[], + protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest | null, + protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse + ] + >; + computeContacts( + request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + > + ): void; + computeContacts( + request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + callback: PaginationCallback< + protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, + | protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse + | null + | undefined, + protos.google.cloud.essentialcontacts.v1.IContact + > + ): void; computeContacts( request?: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, optionsOrCallback?: @@ -1219,7 +1217,8 @@ export class EssentialContactsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['computeContacts']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.computeContacts.createStream( this.innerApiCalls.computeContacts as gax.GaxCall, @@ -1262,11 +1261,8 @@ export class EssentialContactsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.computeContactsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/essential_contacts_service.compute_contacts.js + * region_tag:essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_async */ computeContactsAsync( request?: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, @@ -1280,8 +1276,8 @@ export class EssentialContactsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['computeContacts']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.computeContacts.asyncIterate( this.innerApiCalls['computeContacts'] as GaxCall, From 1c6dcb21fccd1d77067b7581ad737876c195e67d 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:29 +0000 Subject: [PATCH 35/69] build: add generated samples to .eslintignore (#60) --- packages/google-cloud-essentialcontacts/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-essentialcontacts/.eslintignore b/packages/google-cloud-essentialcontacts/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-essentialcontacts/.eslintignore +++ b/packages/google-cloud-essentialcontacts/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From c33a5796b009c6687188a282c2d8cdb9160979d4 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:40:17 +0000 Subject: [PATCH 36/69] docs(node): support "stable"/"preview" release level (#1312) (#63) --- packages/google-cloud-essentialcontacts/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index c265254d7a9..dcea91e838c 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -132,6 +132,8 @@ are addressed with the highest priority. + + More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From ed45bc9661a75f6c4fc468078b62380c806dacac Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Dec 2021 11:44:28 -0500 Subject: [PATCH 37/69] chore: add api_shortname and library_type to repo metadata (#62) --- .../google-cloud-essentialcontacts/.repo-metadata.json | 6 ++++-- packages/google-cloud-essentialcontacts/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/.repo-metadata.json b/packages/google-cloud-essentialcontacts/.repo-metadata.json index 55ee4b9778a..e3d0a77ed9a 100644 --- a/packages/google-cloud-essentialcontacts/.repo-metadata.json +++ b/packages/google-cloud-essentialcontacts/.repo-metadata.json @@ -3,12 +3,14 @@ "product_documentation": "https://cloud.google.com/resource-manager/docs/managing-notification-contacts/", "name": "essentialcontacts", "requires_billing": true, - "release_level": "ga", + "release_level": "stable", "language": "nodejs", "api_id": "essentialcontacts.googleapis.com", "distribution_name": "@google-cloud/essential-contacts", "repo": "googleapis/nodejs-essential-contacts", "issue_tracker": "https://github.com/googleapis/nodejs-essential-contacts/issues", "name_pretty": "Essential Contacts API", - "default_version": "v1" + "default_version": "v1", + "api_shortname": "essentialcontacts", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index dcea91e838c..fe58d294007 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -4,7 +4,7 @@ # [Essential Contacts API: Node.js Client](https://github.com/googleapis/nodejs-essential-contacts) -[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) + [![npm version](https://img.shields.io/npm/v/@google-cloud/essential-contacts.svg)](https://www.npmjs.org/package/@google-cloud/essential-contacts) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-essential-contacts/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-essential-contacts) @@ -122,10 +122,10 @@ _Legacy Node.js versions are supported as a best effort:_ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be **General Availability (GA)**. This means it -is stable; the code surface will not change in backwards-incompatible ways + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **GA** libraries +an extensive deprecation period. Issues and requests against **stable** libraries are addressed with the highest priority. @@ -133,7 +133,6 @@ are addressed with the highest priority. - More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From 67540c799c3a7c8c1136ffd5f48c7094aa73e0c7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 22:42:11 +0000 Subject: [PATCH 38/69] docs(badges): tweak badge to use new preview/stable language (#1314) (#65) --- packages/google-cloud-essentialcontacts/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index fe58d294007..5b880f46862 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -4,9 +4,8 @@ # [Essential Contacts API: Node.js Client](https://github.com/googleapis/nodejs-essential-contacts) - +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/essential-contacts.svg)](https://www.npmjs.org/package/@google-cloud/essential-contacts) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-essential-contacts/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-essential-contacts) From d7f887a4656240e9248a1e2dc18048119b969cc9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:18:33 +0000 Subject: [PATCH 39/69] test(nodejs): remove 15 add 16 (#1322) (#67) --- packages/google-cloud-essentialcontacts/protos/protos.d.ts | 2 +- packages/google-cloud-essentialcontacts/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/protos/protos.d.ts b/packages/google-cloud-essentialcontacts/protos/protos.d.ts index d51e2e898e5..5bd20704a1e 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.d.ts +++ b/packages/google-cloud-essentialcontacts/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-essentialcontacts/protos/protos.js b/packages/google-cloud-essentialcontacts/protos/protos.js index 8101580d5b5..720da243a4c 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.js +++ b/packages/google-cloud-essentialcontacts/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 ea83848364570ac07f5f13d2622c02bd602aba0a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 20 Jan 2022 00:38:19 -0800 Subject: [PATCH 40/69] build: update copyright year to 2022 (#69) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): upgrade gapic-generator-java to 2.4.1 PiperOrigin-RevId: 422607515 Source-Link: https://github.com/googleapis/googleapis/commit/ba2ffd6fe6642e28b4fed2ffae217b4c5f084034 Source-Link: https://github.com/googleapis/googleapis-gen/commit/73ba4add239a619da567ffbd4e5730fdd6de04d3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzNiYTRhZGQyMzlhNjE5ZGE1NjdmZmJkNGU1NzMwZmRkNmRlMDRkMyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-essentialcontacts/.jsdoc.js | 4 ++-- .../v1/essential_contacts_service.compute_contacts.js | 10 ++++------ .../v1/essential_contacts_service.create_contact.js | 4 ++-- .../v1/essential_contacts_service.delete_contact.js | 4 ++-- .../v1/essential_contacts_service.get_contact.js | 4 ++-- .../v1/essential_contacts_service.list_contacts.js | 6 +++--- .../v1/essential_contacts_service.send_test_message.js | 4 ++-- .../v1/essential_contacts_service.update_contact.js | 4 ++-- .../src/v1/essential_contacts_service_client.ts | 2 +- .../google-cloud-essentialcontacts/src/v1/index.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- .../test/gapic_essential_contacts_service_v1.ts | 2 +- 14 files changed, 25 insertions(+), 27 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/.jsdoc.js b/packages/google-cloud-essentialcontacts/.jsdoc.js index 51b2f2434a0..9f31d0e9add 100644 --- a/packages/google-cloud-essentialcontacts/.jsdoc.js +++ b/packages/google-cloud-essentialcontacts/.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/essential-contacts', diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js index 0d0eb508d80..48916975467 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.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 pageToken = 'abc123' // Imports the Essentialcontacts library - const {EssentialContactsServiceClient} = - require('@google-cloud/essential-contacts').v1; + const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1; // Instantiates a client const essentialcontactsClient = new EssentialContactsServiceClient(); @@ -60,11 +60,9 @@ function main(parent) { }; // Run request - const iterable = await essentialcontactsClient.computeContactsAsync( - request - ); + const iterable = await essentialcontactsClient.computeContactsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js index c1e18d7b689..3ad8c2201d4 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, contact) { @@ -32,8 +33,7 @@ function main(parent, contact) { // const contact = {} // Imports the Essentialcontacts library - const {EssentialContactsServiceClient} = - require('@google-cloud/essential-contacts').v1; + const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1; // Instantiates a client const essentialcontactsClient = new EssentialContactsServiceClient(); diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js index 1b6240271be..371b2901f20 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -28,8 +29,7 @@ function main(name) { // const name = 'abc123' // Imports the Essentialcontacts library - const {EssentialContactsServiceClient} = - require('@google-cloud/essential-contacts').v1; + const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1; // Instantiates a client const essentialcontactsClient = new EssentialContactsServiceClient(); diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js index 93ee0d77283..4119ffd1612 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -28,8 +29,7 @@ function main(name) { // const name = 'abc123' // Imports the Essentialcontacts library - const {EssentialContactsServiceClient} = - require('@google-cloud/essential-contacts').v1; + const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1; // Instantiates a client const essentialcontactsClient = new EssentialContactsServiceClient(); diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js index ac811a83cdf..8e4afe70c1f 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -41,8 +42,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Essentialcontacts library - const {EssentialContactsServiceClient} = - require('@google-cloud/essential-contacts').v1; + const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1; // Instantiates a client const essentialcontactsClient = new EssentialContactsServiceClient(); @@ -56,7 +56,7 @@ function main(parent) { // Run request const iterable = await essentialcontactsClient.listContactsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js index 01703532992..e13e4d475d3 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(contacts, resource, notificationCategory) { @@ -41,8 +42,7 @@ function main(contacts, resource, notificationCategory) { // const notificationCategory = {} // Imports the Essentialcontacts library - const {EssentialContactsServiceClient} = - require('@google-cloud/essential-contacts').v1; + const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1; // Instantiates a client const essentialcontactsClient = new EssentialContactsServiceClient(); diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js index 9983c9b10cc..30d98a84700 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(contact) { @@ -32,8 +33,7 @@ function main(contact) { // const updateMask = {} // Imports the Essentialcontacts library - const {EssentialContactsServiceClient} = - require('@google-cloud/essential-contacts').v1; + const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1; // Instantiates a client const essentialcontactsClient = new EssentialContactsServiceClient(); diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts index f7f46a04998..0049f5b338a 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_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-essentialcontacts/src/v1/index.ts b/packages/google-cloud-essentialcontacts/src/v1/index.ts index 38dd766c250..8eb516f56c2 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/index.ts +++ b/packages/google-cloud-essentialcontacts/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.js b/packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.js index 0ddd63c155f..97c68b1fef9 100644 --- a/packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-essentialcontacts/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-essentialcontacts/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.ts index 06957029538..5d710cf6a8a 100644 --- a/packages/google-cloud-essentialcontacts/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-essentialcontacts/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-essentialcontacts/system-test/install.ts b/packages/google-cloud-essentialcontacts/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-essentialcontacts/system-test/install.ts +++ b/packages/google-cloud-essentialcontacts/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-essentialcontacts/test/gapic_essential_contacts_service_v1.ts b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts index 56f1e8ead53..8a6313324ee 100644 --- a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts +++ b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 968dd5178a6371c2cee78790d522a570dcdf3872 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 27 Jan 2022 16:32:28 +0000 Subject: [PATCH 41/69] chore: update v2.12.0 gapic-generator-typescript (#71) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 424244721 Source-Link: https://github.com/googleapis/googleapis/commit/4b6b01f507ebc3df95fdf8e1d76b0ae0ae33e52c Source-Link: https://github.com/googleapis/googleapis-gen/commit/8ac83fba606d008c7e8a42e7d55b6596ec4be35f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGFjODNmYmE2MDZkMDA4YzdlOGE0MmU3ZDU1YjY1OTZlYzRiZTM1ZiJ9 --- .../linkinator.config.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/linkinator.config.json b/packages/google-cloud-essentialcontacts/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-essentialcontacts/linkinator.config.json +++ b/packages/google-cloud-essentialcontacts/linkinator.config.json @@ -3,8 +3,14 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" ], "silent": true, - "concurrency": 5 + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 } From 8ca665ffe90476165537e8924967407df1e4b600 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 2 Feb 2022 17:03:02 +0100 Subject: [PATCH 42/69] chore(deps): update dependency sinon to v13 (#73) 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-essential-contacts). --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index bc98e1b0d38..e7d4b949318 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -54,7 +54,7 @@ "mocha": "^9.0.0", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^12.0.0", + "sinon": "^13.0.0", "ts-loader": "^9.1.2", "typescript": "^4.2.4", "webpack": "^5.36.2", From 198a0a2a4a67ae299a8df193423c69a7f9448524 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:32:40 +0000 Subject: [PATCH 43/69] docs(nodejs): version support policy edits (#1346) (#75) --- .../google-cloud-essentialcontacts/README.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index 5b880f46862..8a79d9d126f 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -100,21 +100,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/essential-contacts@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From f10e8b0c6718c3a084703866eaa6546c716be7a8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 02:05:03 +0000 Subject: [PATCH 44/69] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#76) - [ ] 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 --- ...ntial_contacts_service.compute_contacts.js | 9 +- ...sential_contacts_service.create_contact.js | 9 +- ...sential_contacts_service.delete_contact.js | 9 +- .../essential_contacts_service.get_contact.js | 9 +- ...ssential_contacts_service.list_contacts.js | 9 +- ...tial_contacts_service.send_test_message.js | 9 +- ...sential_contacts_service.update_contact.js | 9 +- ...ata.google.cloud.essentialcontacts.v1.json | 331 ++++++++++++++++++ .../v1/essential_contacts_service_client.ts | 5 +- .../gapic_essential_contacts_service_v1.ts | 106 +++++- 10 files changed, 486 insertions(+), 19 deletions(-) create mode 100644 packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js index 48916975467..00d490a382c 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.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-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js index 3ad8c2201d4..f1fd31c1ee4 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js index 371b2901f20..3d046c698e4 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js index 4119ffd1612..72516220140 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js index 8e4afe70c1f..2c6469d9d60 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.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-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js index e13e4d475d3..122460f04ba 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.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-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js index 30d98a84700..c81be34797d 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.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-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json new file mode 100644 index 00000000000..7ccf018e230 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json @@ -0,0 +1,331 @@ +{ + "clientLibrary": { + "name": "nodejs-essentialcontacts", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.essentialcontacts.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_CreateContact_async", + "title": "EssentialContactsService createContact Sample", + "origin": "API_DEFINITION", + "description": " Adds a new contact for a resource.", + "canonical": true, + "file": "essential_contacts_service.create_contact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.CreateContact", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "contact", + "type": ".google.cloud.essentialcontacts.v1.Contact" + } + ], + "resultType": ".google.cloud.essentialcontacts.v1.Contact", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "CreateContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.CreateContact", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } + }, + { + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_UpdateContact_async", + "title": "EssentialContactsService updateContact Sample", + "origin": "API_DEFINITION", + "description": " Updates a contact. Note: A contact's email address cannot be changed.", + "canonical": true, + "file": "essential_contacts_service.update_contact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.UpdateContact", + "async": true, + "parameters": [ + { + "name": "contact", + "type": ".google.cloud.essentialcontacts.v1.Contact" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.essentialcontacts.v1.Contact", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "UpdateContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.UpdateContact", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } + }, + { + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_ListContacts_async", + "title": "EssentialContactsService listContacts Sample", + "origin": "API_DEFINITION", + "description": " Lists the contacts that have been set on a resource.", + "canonical": true, + "file": "essential_contacts_service.list_contacts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListContacts", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ListContacts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.essentialcontacts.v1.ListContactsResponse", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "ListContacts", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ListContacts", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } + }, + { + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_GetContact_async", + "title": "EssentialContactsService getContact Sample", + "origin": "API_DEFINITION", + "description": " Gets a single contact.", + "canonical": true, + "file": "essential_contacts_service.get_contact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.GetContact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.essentialcontacts.v1.Contact", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "GetContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.GetContact", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } + }, + { + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_async", + "title": "EssentialContactsService deleteContact Sample", + "origin": "API_DEFINITION", + "description": " Deletes a contact.", + "canonical": true, + "file": "essential_contacts_service.delete_contact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.DeleteContact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "DeleteContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.DeleteContact", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } + }, + { + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_async", + "title": "EssentialContactsService computeContacts Sample", + "origin": "API_DEFINITION", + "description": " Lists all contacts for the resource that are subscribed to the specified notification categories, including contacts inherited from any parent resources.", + "canonical": true, + "file": "essential_contacts_service.compute_contacts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ComputeContacts", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ComputeContacts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "notification_categories", + "type": "TYPE_ENUM[]" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.essentialcontacts.v1.ComputeContactsResponse", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "ComputeContacts", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ComputeContacts", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } + }, + { + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_SendTestMessage_async", + "title": "EssentialContactsService sendTestMessage Sample", + "origin": "API_DEFINITION", + "description": " Allows a contact admin to send a test message to contact to verify that it has been configured correctly.", + "canonical": true, + "file": "essential_contacts_service.send_test_message.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SendTestMessage", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.SendTestMessage", + "async": true, + "parameters": [ + { + "name": "contacts", + "type": "TYPE_STRING[]" + }, + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "notification_category", + "type": ".google.cloud.essentialcontacts.v1.NotificationCategory" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "SendTestMessage", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.SendTestMessage", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts index 0049f5b338a..91d57d9c98a 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts @@ -1439,9 +1439,8 @@ export class EssentialContactsServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.essentialContactsServiceStub!.then(stub => { + if (this.essentialContactsServiceStub && !this._terminated) { + return this.essentialContactsServiceStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts index 8a6313324ee..72c55034582 100644 --- a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts +++ b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts @@ -159,13 +159,29 @@ describe('v1.EssentialContactsServiceClient', () => { assert(client.essentialContactsServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.essentialContactsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.essentialContactsServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -316,6 +332,23 @@ describe('v1.EssentialContactsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createContact with closed client', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createContact(request), expectedError); + }); }); describe('updateContact', () => { @@ -433,6 +466,24 @@ describe('v1.EssentialContactsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateContact with closed client', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() + ); + request.contact = {}; + request.contact.name = ''; + const expectedHeaderRequestParams = 'contact.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateContact(request), expectedError); + }); }); describe('getContact', () => { @@ -547,6 +598,23 @@ describe('v1.EssentialContactsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getContact with closed client', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.GetContactRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getContact(request), expectedError); + }); }); describe('deleteContact', () => { @@ -661,6 +729,23 @@ describe('v1.EssentialContactsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteContact with closed client', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteContact(request), expectedError); + }); }); describe('sendTestMessage', () => { @@ -775,6 +860,23 @@ describe('v1.EssentialContactsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes sendTestMessage with closed client', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.sendTestMessage(request), expectedError); + }); }); describe('listContacts', () => { From 2f975d751a4c5f964e3a98075d812a0b5ad20e95 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:16 +0000 Subject: [PATCH 45/69] chore: update v2.14.2 gapic-generator-typescript (#80) - [ ] 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_essential_contacts_service_v1.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts index 72c55034582..1b3d957de99 100644 --- a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts +++ b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts @@ -344,7 +344,6 @@ describe('v1.EssentialContactsServiceClient', () => { new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createContact(request), expectedError); @@ -479,7 +478,6 @@ describe('v1.EssentialContactsServiceClient', () => { ); request.contact = {}; request.contact.name = ''; - const expectedHeaderRequestParams = 'contact.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateContact(request), expectedError); @@ -610,7 +608,6 @@ describe('v1.EssentialContactsServiceClient', () => { new protos.google.cloud.essentialcontacts.v1.GetContactRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getContact(request), expectedError); @@ -741,7 +738,6 @@ describe('v1.EssentialContactsServiceClient', () => { new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteContact(request), expectedError); @@ -872,7 +868,6 @@ describe('v1.EssentialContactsServiceClient', () => { new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.sendTestMessage(request), expectedError); From 4153474d3a3c7230b1373d1410104c6171709227 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 12:47:31 -0700 Subject: [PATCH 46/69] build(node): update client library version in samples metadata (#1356) (#87) * build(node): add feat in node post-processor to add client library version number in snippet metadata Co-authored-by: Benjamin E. Coe Source-Link: https://github.com/googleapis/synthtool/commit/d337b88dd1494365183718a2de0b7b4056b6fdfe Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:d106724ad2a96daa1b8d88de101ba50bdb30b8df62ffa0aa2b451d93b4556641 Co-authored-by: Owl Bot Co-authored-by: Benjamin E. Coe --- ...ata.google.cloud.essentialcontacts.v1.json | 632 +++++++++--------- 1 file changed, 316 insertions(+), 316 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json index 7ccf018e230..567e977453a 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json @@ -1,331 +1,331 @@ { - "clientLibrary": { - "name": "nodejs-essentialcontacts", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.essentialcontacts.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_CreateContact_async", - "title": "EssentialContactsService createContact Sample", - "origin": "API_DEFINITION", - "description": " Adds a new contact for a resource.", - "canonical": true, - "file": "essential_contacts_service.create_contact.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateContact", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.CreateContact", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "contact", - "type": ".google.cloud.essentialcontacts.v1.Contact" - } - ], - "resultType": ".google.cloud.essentialcontacts.v1.Contact", - "client": { - "shortName": "EssentialContactsServiceClient", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" - }, - "method": { - "shortName": "CreateContact", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.CreateContact", - "service": { - "shortName": "EssentialContactsService", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" - } - } - } + "clientLibrary": { + "name": "nodejs-essentialcontacts", + "version": "1.1.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.essentialcontacts.v1", + "version": "v1" + } + ] }, - { - "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_UpdateContact_async", - "title": "EssentialContactsService updateContact Sample", - "origin": "API_DEFINITION", - "description": " Updates a contact. Note: A contact's email address cannot be changed.", - "canonical": true, - "file": "essential_contacts_service.update_contact.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateContact", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.UpdateContact", - "async": true, - "parameters": [ - { - "name": "contact", - "type": ".google.cloud.essentialcontacts.v1.Contact" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.essentialcontacts.v1.Contact", - "client": { - "shortName": "EssentialContactsServiceClient", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_CreateContact_async", + "title": "EssentialContactsService createContact Sample", + "origin": "API_DEFINITION", + "description": " Adds a new contact for a resource.", + "canonical": true, + "file": "essential_contacts_service.create_contact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.CreateContact", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "contact", + "type": ".google.cloud.essentialcontacts.v1.Contact" + } + ], + "resultType": ".google.cloud.essentialcontacts.v1.Contact", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "CreateContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.CreateContact", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } }, - "method": { - "shortName": "UpdateContact", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.UpdateContact", - "service": { - "shortName": "EssentialContactsService", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" - } - } - } - }, - { - "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_ListContacts_async", - "title": "EssentialContactsService listContacts Sample", - "origin": "API_DEFINITION", - "description": " Lists the contacts that have been set on a resource.", - "canonical": true, - "file": "essential_contacts_service.list_contacts.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListContacts", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ListContacts", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.essentialcontacts.v1.ListContactsResponse", - "client": { - "shortName": "EssentialContactsServiceClient", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_UpdateContact_async", + "title": "EssentialContactsService updateContact Sample", + "origin": "API_DEFINITION", + "description": " Updates a contact. Note: A contact's email address cannot be changed.", + "canonical": true, + "file": "essential_contacts_service.update_contact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.UpdateContact", + "async": true, + "parameters": [ + { + "name": "contact", + "type": ".google.cloud.essentialcontacts.v1.Contact" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.essentialcontacts.v1.Contact", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "UpdateContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.UpdateContact", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } }, - "method": { - "shortName": "ListContacts", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ListContacts", - "service": { - "shortName": "EssentialContactsService", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" - } - } - } - }, - { - "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_GetContact_async", - "title": "EssentialContactsService getContact Sample", - "origin": "API_DEFINITION", - "description": " Gets a single contact.", - "canonical": true, - "file": "essential_contacts_service.get_contact.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetContact", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.GetContact", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.essentialcontacts.v1.Contact", - "client": { - "shortName": "EssentialContactsServiceClient", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_ListContacts_async", + "title": "EssentialContactsService listContacts Sample", + "origin": "API_DEFINITION", + "description": " Lists the contacts that have been set on a resource.", + "canonical": true, + "file": "essential_contacts_service.list_contacts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListContacts", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ListContacts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.essentialcontacts.v1.ListContactsResponse", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "ListContacts", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ListContacts", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } }, - "method": { - "shortName": "GetContact", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.GetContact", - "service": { - "shortName": "EssentialContactsService", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" - } - } - } - }, - { - "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_async", - "title": "EssentialContactsService deleteContact Sample", - "origin": "API_DEFINITION", - "description": " Deletes a contact.", - "canonical": true, - "file": "essential_contacts_service.delete_contact.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteContact", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.DeleteContact", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "EssentialContactsServiceClient", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_GetContact_async", + "title": "EssentialContactsService getContact Sample", + "origin": "API_DEFINITION", + "description": " Gets a single contact.", + "canonical": true, + "file": "essential_contacts_service.get_contact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.GetContact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.essentialcontacts.v1.Contact", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "GetContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.GetContact", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } }, - "method": { - "shortName": "DeleteContact", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.DeleteContact", - "service": { - "shortName": "EssentialContactsService", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" - } - } - } - }, - { - "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_async", - "title": "EssentialContactsService computeContacts Sample", - "origin": "API_DEFINITION", - "description": " Lists all contacts for the resource that are subscribed to the specified notification categories, including contacts inherited from any parent resources.", - "canonical": true, - "file": "essential_contacts_service.compute_contacts.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ComputeContacts", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ComputeContacts", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "notification_categories", - "type": "TYPE_ENUM[]" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.essentialcontacts.v1.ComputeContactsResponse", - "client": { - "shortName": "EssentialContactsServiceClient", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_async", + "title": "EssentialContactsService deleteContact Sample", + "origin": "API_DEFINITION", + "description": " Deletes a contact.", + "canonical": true, + "file": "essential_contacts_service.delete_contact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.DeleteContact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "DeleteContact", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.DeleteContact", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } }, - "method": { - "shortName": "ComputeContacts", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ComputeContacts", - "service": { - "shortName": "EssentialContactsService", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" - } - } - } - }, - { - "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_SendTestMessage_async", - "title": "EssentialContactsService sendTestMessage Sample", - "origin": "API_DEFINITION", - "description": " Allows a contact admin to send a test message to contact to verify that it has been configured correctly.", - "canonical": true, - "file": "essential_contacts_service.send_test_message.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SendTestMessage", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.SendTestMessage", - "async": true, - "parameters": [ - { - "name": "contacts", - "type": "TYPE_STRING[]" - }, - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "notification_category", - "type": ".google.cloud.essentialcontacts.v1.NotificationCategory" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "EssentialContactsServiceClient", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_async", + "title": "EssentialContactsService computeContacts Sample", + "origin": "API_DEFINITION", + "description": " Lists all contacts for the resource that are subscribed to the specified notification categories, including contacts inherited from any parent resources.", + "canonical": true, + "file": "essential_contacts_service.compute_contacts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ComputeContacts", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ComputeContacts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "notification_categories", + "type": "TYPE_ENUM[]" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.essentialcontacts.v1.ComputeContactsResponse", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "ComputeContacts", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.ComputeContacts", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } }, - "method": { - "shortName": "SendTestMessage", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.SendTestMessage", - "service": { - "shortName": "EssentialContactsService", - "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" - } + { + "regionTag": "essentialcontacts_v1_generated_EssentialContactsService_SendTestMessage_async", + "title": "EssentialContactsService sendTestMessage Sample", + "origin": "API_DEFINITION", + "description": " Allows a contact admin to send a test message to contact to verify that it has been configured correctly.", + "canonical": true, + "file": "essential_contacts_service.send_test_message.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SendTestMessage", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.SendTestMessage", + "async": true, + "parameters": [ + { + "name": "contacts", + "type": "TYPE_STRING[]" + }, + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "notification_category", + "type": ".google.cloud.essentialcontacts.v1.NotificationCategory" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "EssentialContactsServiceClient", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsServiceClient" + }, + "method": { + "shortName": "SendTestMessage", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService.SendTestMessage", + "service": { + "shortName": "EssentialContactsService", + "fullName": "google.cloud.essentialcontacts.v1.EssentialContactsService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From bd5bd9bd74191267ecb1c86cd762d4b8c33da124 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:40:19 +0200 Subject: [PATCH 47/69] chore(deps): update dependency sinon to v14 (#90) 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-essential-contacts). --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index e7d4b949318..ae1d9fd4f0a 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -54,7 +54,7 @@ "mocha": "^9.0.0", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", + "sinon": "^14.0.0", "ts-loader": "^9.1.2", "typescript": "^4.2.4", "webpack": "^5.36.2", From abedf68b515f7a5a5c645326f7879d40030e5437 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 18 May 2022 18:52:27 -0700 Subject: [PATCH 48/69] build!: update library to use Node 12 (#92) * build!: Update library to use Node 12 Co-authored-by: Owl Bot --- packages/google-cloud-essentialcontacts/package.json | 8 ++++---- .../google-cloud-essentialcontacts/samples/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index ae1d9fd4f0a..aeec68ba8b0 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.24.1" + "google-gax": "^3.0.1" }, "devDependencies": { "@types/mocha": "^9.0.0", @@ -51,16 +51,16 @@ "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.6", "linkinator": "^2.13.6", - "mocha": "^9.0.0", + "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", "sinon": "^14.0.0", "ts-loader": "^9.1.2", - "typescript": "^4.2.4", + "typescript": "^4.6.4", "webpack": "^5.36.2", "webpack-cli": "^4.7.0" }, "engines": { - "node": ">=v10.24.0" + "node": ">=12.0.0" } } diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 4957b33b544..c6031846571 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" From fcbf233dad8396453127440a7b02fd799d2ab6c7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 12:02:57 -0400 Subject: [PATCH 49/69] chore(main): release 2.0.0 (#93) 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-essentialcontacts/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-essentialcontacts/package.json | 2 +- ...et_metadata.google.cloud.essentialcontacts.v1.json | 2 +- .../samples/package.json | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index 6c03c1a941a..bf1ede60dec 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.0.0](https://github.com/googleapis/nodejs-essential-contacts/compare/v1.1.1...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#92) + +### Build System + +* update library to use Node 12 ([#92](https://github.com/googleapis/nodejs-essential-contacts/issues/92)) ([b819928](https://github.com/googleapis/nodejs-essential-contacts/commit/b819928b746a8a819080416da1b06b91f88b1f20)) + ### [1.1.1](https://www.github.com/googleapis/nodejs-essential-contacts/compare/v1.1.0...v1.1.1) (2021-08-25) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index aeec68ba8b0..3faf5b6787b 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "1.1.1", + "version": "2.0.0", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json index 567e977453a..a712916422b 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-essentialcontacts", - "version": "1.1.1", + "version": "2.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index c6031846571..dc78b841bb2 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "^1.1.1" + "@google-cloud/essential-contacts": "^2.0.0" }, "devDependencies": { "c8": "^7.1.0", From fc52747becba83d2cf57b837a41cc7d7eaf434d0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 16:58:24 +0200 Subject: [PATCH 50/69] chore(deps): update dependency jsdoc-region-tag to v2 (#97) 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-essential-contacts). --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 3faf5b6787b..4b82f7a05b3 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -49,7 +49,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.13.6", "mocha": "^9.2.2", "null-loader": "^4.0.1", From 24fe566943143f81c464b260a033f9154fb262a3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:26:12 +0200 Subject: [PATCH 51/69] chore(deps): update dependency jsdoc-fresh to v2 (#96) 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-essential-contacts). --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 4b82f7a05b3..6d8711870d6 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -48,7 +48,7 @@ "c8": "^7.7.2", "gts": "^3.1.0", "jsdoc": "^3.6.6", - "jsdoc-fresh": "^1.0.2", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.13.6", "mocha": "^9.2.2", From b865cf98d5ece894934dd97a22c9d1fd6fd78fb0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:11:19 -0700 Subject: [PATCH 52/69] fix(docs): describe fallback rest option (#98) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support regapic LRO Use gapic-generator-typescript v2.15.1. PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../src/v1/essential_contacts_service_client.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts index 91d57d9c98a..6a1b1b7cad0 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts @@ -70,7 +70,7 @@ export class EssentialContactsServiceClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -93,11 +93,10 @@ export class EssentialContactsServiceClient { * 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 1fe15e821398bfbe4b026e0c375318b6b54a5055 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 19:36:23 +0000 Subject: [PATCH 53/69] chore(main): release 2.0.1 (#99) :robot: I have created a release *beep* *boop* --- ## [2.0.1](https://github.com/googleapis/nodejs-essential-contacts/compare/v2.0.0...v2.0.1) (2022-06-30) ### Bug Fixes * **docs:** describe fallback rest option ([#98](https://github.com/googleapis/nodejs-essential-contacts/issues/98)) ([1ed45c6](https://github.com/googleapis/nodejs-essential-contacts/commit/1ed45c6a2b197f7784e13857c481d097da96dc6d)) --- 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-essentialcontacts/CHANGELOG.md | 7 +++++++ packages/google-cloud-essentialcontacts/package.json | 2 +- ...snippet_metadata.google.cloud.essentialcontacts.v1.json | 2 +- .../google-cloud-essentialcontacts/samples/package.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index bf1ede60dec..840e12fbc17 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.0.1](https://github.com/googleapis/nodejs-essential-contacts/compare/v2.0.0...v2.0.1) (2022-06-30) + + +### Bug Fixes + +* **docs:** describe fallback rest option ([#98](https://github.com/googleapis/nodejs-essential-contacts/issues/98)) ([1ed45c6](https://github.com/googleapis/nodejs-essential-contacts/commit/1ed45c6a2b197f7784e13857c481d097da96dc6d)) + ## [2.0.0](https://github.com/googleapis/nodejs-essential-contacts/compare/v1.1.1...v2.0.0) (2022-05-19) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 6d8711870d6..9f73d4978e7 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "2.0.0", + "version": "2.0.1", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json index a712916422b..8b33462917b 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-essentialcontacts", - "version": "2.0.0", + "version": "2.0.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index dc78b841bb2..2b969d94266 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "^2.0.0" + "@google-cloud/essential-contacts": "^2.0.1" }, "devDependencies": { "c8": "^7.1.0", From 2c55ebe931a5120a8d7e045bbb322ba626f9c10d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 13 Jul 2022 01:58:46 +0200 Subject: [PATCH 54/69] chore(deps): update dependency linkinator to v4 (#104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [linkinator](https://togithub.com/JustinBeckwith/linkinator) | [`^2.13.6` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.2) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
JustinBeckwith/linkinator ### [`v4.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v4.0.1...v4.0.2) ##### Bug Fixes - address srcset parsing with multiple spaces ([#​512](https://togithub.com/JustinBeckwith/linkinator/issues/512)) ([fefb5b6](https://togithub.com/JustinBeckwith/linkinator/commit/fefb5b6734fc4ab335793358c5f491338ecbeb90)) ### [`v4.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v4.0.0...v4.0.1) ##### Bug Fixes - properly parse srcset attribute ([#​510](https://togithub.com/JustinBeckwith/linkinator/issues/510)) ([9a8a83c](https://togithub.com/JustinBeckwith/linkinator/commit/9a8a83c35182b3cd4daee62a00f156767fe5c6a7)) ### [`v4.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.1.0...v4.0.0) ##### Features - create new release with notes ([#​508](https://togithub.com/JustinBeckwith/linkinator/issues/508)) ([2cab633](https://togithub.com/JustinBeckwith/linkinator/commit/2cab633c9659eb10794a4bac06f8b0acdc3e2c0c)) ##### BREAKING CHANGES - The commits in [#​507](https://togithub.com/JustinBeckwith/linkinator/issues/507) and [#​506](https://togithub.com/JustinBeckwith/linkinator/issues/506) both had breaking changes. They included dropping support for Node.js 12.x and updating the CSV export to be streaming, and to use a new way of writing the CSV file. This is an empty to commit using the `BREAKING CHANGE` format in the commit message to ensure a release is triggered. ### [`v3.1.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.1.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.6...v3.1.0) ##### Features - allow --skip to be defined multiple times ([#​399](https://togithub.com/JustinBeckwith/linkinator/issues/399)) ([5ca5a46](https://togithub.com/JustinBeckwith/linkinator/commit/5ca5a461508e688de12e5ae6b4cfb6565f832ebf)) ### [`v3.0.6`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.6) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.5...v3.0.6) ##### Bug Fixes - **deps:** upgrade node-glob to v8 ([#​397](https://togithub.com/JustinBeckwith/linkinator/issues/397)) ([d334dc6](https://togithub.com/JustinBeckwith/linkinator/commit/d334dc6734cd7c2b73d7ed3dea0550a6c3072ad5)) ### [`v3.0.5`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.5) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.4...v3.0.5) ##### Bug Fixes - **deps:** upgrade to htmlparser2 v8.0.1 ([#​396](https://togithub.com/JustinBeckwith/linkinator/issues/396)) ([ba3b9a8](https://togithub.com/JustinBeckwith/linkinator/commit/ba3b9a8a9b19d39af6ed91790135e833b80c1eb6)) ### [`v3.0.4`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.4) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.3...v3.0.4) ##### Bug Fixes - **deps:** update dependency gaxios to v5 ([#​391](https://togithub.com/JustinBeckwith/linkinator/issues/391)) ([48af50e](https://togithub.com/JustinBeckwith/linkinator/commit/48af50e787731204aeb7eff41325c62291311e45)) ### [`v3.0.3`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.3) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.2...v3.0.3) ##### Bug Fixes - export getConfig from index ([#​371](https://togithub.com/JustinBeckwith/linkinator/issues/371)) ([0bc0355](https://togithub.com/JustinBeckwith/linkinator/commit/0bc0355c7e2ea457f247e6b52d1577b8c4ecb3a1)) ### [`v3.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.1...v3.0.2) ##### Bug Fixes - allow server root with trailing slash ([#​370](https://togithub.com/JustinBeckwith/linkinator/issues/370)) ([8adf6b0](https://togithub.com/JustinBeckwith/linkinator/commit/8adf6b025fda250e38461f1cdad40fe08c3b3b7c)) ### [`v3.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.0...v3.0.1) ##### Bug Fixes - decode path parts in local web server ([#​369](https://togithub.com/JustinBeckwith/linkinator/issues/369)) ([4696a0c](https://togithub.com/JustinBeckwith/linkinator/commit/4696a0c38c341b178ed815f47371fca955979feb)) ### [`v3.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v2.16.2...v3.0.0) ##### Bug Fixes - **deps:** update dependency chalk to v5 ([#​362](https://togithub.com/JustinBeckwith/linkinator/issues/362)) ([4b17a8d](https://togithub.com/JustinBeckwith/linkinator/commit/4b17a8d87b649eaf813428f8ee6955e1d21dae4f)) - feat!: convert to es modules, drop node 10 ([#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359)) ([efee299](https://togithub.com/JustinBeckwith/linkinator/commit/efee299ab8a805accef751eecf8538915a4e7783)), closes [#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359) ##### BREAKING CHANGES - this module now requires node.js 12 and above, and has moved to es modules by default.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-essential-contacts). --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 9f73d4978e7..f9ad8ddbc3e 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -50,7 +50,7 @@ "jsdoc": "^3.6.6", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.13.6", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", From eccee7d1bd753b12c9c6376e046df83664595068 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 00:08:15 +0000 Subject: [PATCH 55/69] fix: better support for fallback mode (#105) - [ ] 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 --- ...ntial_contacts_service.compute_contacts.js | 3 + ...sential_contacts_service.create_contact.js | 3 + ...sential_contacts_service.delete_contact.js | 3 + .../essential_contacts_service.get_contact.js | 3 + ...ssential_contacts_service.list_contacts.js | 3 + ...tial_contacts_service.send_test_message.js | 3 + ...sential_contacts_service.update_contact.js | 3 + ...ata.google.cloud.essentialcontacts.v1.json | 14 +- .../v1/essential_contacts_service_client.ts | 12 +- .../gapic_essential_contacts_service_v1.ts | 182 +++++++++--------- 10 files changed, 126 insertions(+), 103 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js index 00d490a382c..40dacdbb79e 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js @@ -23,6 +23,9 @@ function main(parent) { // [START essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_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-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js index f1fd31c1ee4..a087e10aad1 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js @@ -23,6 +23,9 @@ function main(parent, contact) { // [START essentialcontacts_v1_generated_EssentialContactsService_CreateContact_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-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js index 3d046c698e4..6f5d017abb7 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js @@ -23,6 +23,9 @@ function main(name) { // [START essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_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-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js index 72516220140..c62013a9e33 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js @@ -23,6 +23,9 @@ function main(name) { // [START essentialcontacts_v1_generated_EssentialContactsService_GetContact_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-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js index 2c6469d9d60..ed35bd79924 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js @@ -23,6 +23,9 @@ function main(parent) { // [START essentialcontacts_v1_generated_EssentialContactsService_ListContacts_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-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js index 122460f04ba..64e2c8dcf3c 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js @@ -23,6 +23,9 @@ function main(contacts, resource, notificationCategory) { // [START essentialcontacts_v1_generated_EssentialContactsService_SendTestMessage_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-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js index c81be34797d..92ad81762ac 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js @@ -23,6 +23,9 @@ function main(contact) { // [START essentialcontacts_v1_generated_EssentialContactsService_UpdateContact_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-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json index 8b33462917b..9613365be0b 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -110,7 +110,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -198,7 +198,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -238,7 +238,7 @@ "segments": [ { "start": 25, - "end": 74, + "end": 77, "type": "FULL" } ], @@ -290,7 +290,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts index 6a1b1b7cad0..3ee4db18c05 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts @@ -28,7 +28,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -272,7 +271,8 @@ export class EssentialContactsServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -997,7 +997,7 @@ export class EssentialContactsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listContacts.createStream( - this.innerApiCalls.listContacts as gax.GaxCall, + this.innerApiCalls.listContacts as GaxCall, request, callSettings ); @@ -1053,7 +1053,7 @@ export class EssentialContactsServiceClient { this.initialize(); return this.descriptors.page.listContacts.asyncIterate( this.innerApiCalls['listContacts'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -1220,7 +1220,7 @@ export class EssentialContactsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.computeContacts.createStream( - this.innerApiCalls.computeContacts as gax.GaxCall, + this.innerApiCalls.computeContacts as GaxCall, request, callSettings ); @@ -1280,7 +1280,7 @@ export class EssentialContactsServiceClient { this.initialize(); return this.descriptors.page.computeContacts.asyncIterate( this.innerApiCalls['computeContacts'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts index 1b3d957de99..07484d87cbf 100644 --- a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts +++ b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts @@ -113,111 +113,113 @@ function stubAsyncIterationCall( } describe('v1.EssentialContactsServiceClient', () => { - it('has servicePath', () => { - const servicePath = - essentialcontactsserviceModule.v1.EssentialContactsServiceClient - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + essentialcontactsserviceModule.v1.EssentialContactsServiceClient + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - essentialcontactsserviceModule.v1.EssentialContactsServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + essentialcontactsserviceModule.v1.EssentialContactsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - essentialcontactsserviceModule.v1.EssentialContactsServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + essentialcontactsserviceModule.v1.EssentialContactsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + fallback: true, + }); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.essentialContactsServiceStub, undefined); - await client.initialize(); - assert(client.essentialContactsServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.essentialContactsServiceStub, undefined); + await client.initialize(); + assert(client.essentialContactsServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.essentialContactsServiceStub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.essentialContactsServiceStub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.essentialContactsServiceStub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.essentialContactsServiceStub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - 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 essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + 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 essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ - 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 essentialcontactsserviceModule.v1.EssentialContactsServiceClient({ + 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('createContact', () => { From c4154030f348836fd5eb9bb30915c15642df4ebc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 07:36:13 +0000 Subject: [PATCH 56/69] fix: change import long to require (#106) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../protos/protos.d.ts | 359 ++- .../protos/protos.js | 2369 ++++++++++++----- .../protos/protos.json | 24 + 3 files changed, 2041 insertions(+), 711 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/protos/protos.d.ts b/packages/google-cloud-essentialcontacts/protos/protos.d.ts index 5bd20704a1e..d46ca1a9db4 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.d.ts +++ b/packages/google-cloud-essentialcontacts/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 { @@ -168,49 +168,49 @@ export namespace google { namespace EssentialContactsService { /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#createContact}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|createContact}. * @param error Error, if any * @param [response] Contact */ type CreateContactCallback = (error: (Error|null), response?: google.cloud.essentialcontacts.v1.Contact) => void; /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#updateContact}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|updateContact}. * @param error Error, if any * @param [response] Contact */ type UpdateContactCallback = (error: (Error|null), response?: google.cloud.essentialcontacts.v1.Contact) => void; /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#listContacts}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|listContacts}. * @param error Error, if any * @param [response] ListContactsResponse */ type ListContactsCallback = (error: (Error|null), response?: google.cloud.essentialcontacts.v1.ListContactsResponse) => void; /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#getContact}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|getContact}. * @param error Error, if any * @param [response] Contact */ type GetContactCallback = (error: (Error|null), response?: google.cloud.essentialcontacts.v1.Contact) => void; /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#deleteContact}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|deleteContact}. * @param error Error, if any * @param [response] Empty */ type DeleteContactCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#computeContacts}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|computeContacts}. * @param error Error, if any * @param [response] ComputeContactsResponse */ type ComputeContactsCallback = (error: (Error|null), response?: google.cloud.essentialcontacts.v1.ComputeContactsResponse) => void; /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#sendTestMessage}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|sendTestMessage}. * @param error Error, if any * @param [response] Empty */ @@ -335,6 +335,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Contact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListContactsRequest. */ @@ -437,6 +444,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListContactsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListContactsResponse. */ @@ -533,6 +547,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListContactsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetContactRequest. */ @@ -623,6 +644,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetContactRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteContactRequest. */ @@ -713,6 +741,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteContactRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateContactRequest. */ @@ -809,6 +844,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateContactRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateContactRequest. */ @@ -905,6 +947,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateContactRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ComputeContactsRequest. */ @@ -1013,6 +1062,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeContactsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ComputeContactsResponse. */ @@ -1109,6 +1165,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeContactsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SendTestMessageRequest. */ @@ -1211,6 +1274,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SendTestMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -1313,6 +1383,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. */ @@ -1460,6 +1537,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. */ @@ -1556,6 +1640,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. */ @@ -1694,6 +1785,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 { @@ -1806,6 +1904,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; } } @@ -1900,6 +2005,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. */ @@ -1940,6 +2052,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -1987,6 +2102,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 @@ -2056,6 +2174,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. */ @@ -2200,6 +2325,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 { @@ -2304,6 +2436,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. */ @@ -2400,6 +2539,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; } } @@ -2491,6 +2637,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. */ @@ -2641,6 +2794,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 { @@ -2769,6 +2929,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. */ @@ -2883,6 +3050,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 { @@ -2981,6 +3155,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; } } @@ -3084,6 +3265,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. */ @@ -3186,6 +3374,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. */ @@ -3306,6 +3501,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. */ @@ -3519,6 +3721,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 { @@ -3646,6 +3855,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. */ @@ -3663,6 +3879,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -3700,6 +3919,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -3778,6 +4000,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 { @@ -3885,6 +4114,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. */ @@ -3987,6 +4223,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. */ @@ -4083,6 +4326,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. */ @@ -4185,6 +4435,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. */ @@ -4293,6 +4550,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 { @@ -4429,6 +4693,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 { @@ -4527,6 +4798,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; } } @@ -4618,6 +4896,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 { @@ -4734,6 +5019,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; } } @@ -4825,6 +5117,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 { @@ -4843,6 +5142,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. */ @@ -4866,6 +5168,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 @@ -4935,6 +5240,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 + } } } @@ -5020,6 +5342,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FieldMask. */ @@ -5110,6 +5439,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Timestamp. */ @@ -5206,6 +5542,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } diff --git a/packages/google-cloud-essentialcontacts/protos/protos.js b/packages/google-cloud-essentialcontacts/protos/protos.js index 720da243a4c..98bc6ffc303 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.js +++ b/packages/google-cloud-essentialcontacts/protos/protos.js @@ -143,7 +143,7 @@ }; /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#createContact}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|createContact}. * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService * @typedef CreateContactCallback * @type {function} @@ -176,7 +176,7 @@ */ /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#updateContact}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|updateContact}. * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService * @typedef UpdateContactCallback * @type {function} @@ -209,7 +209,7 @@ */ /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#listContacts}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|listContacts}. * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService * @typedef ListContactsCallback * @type {function} @@ -242,7 +242,7 @@ */ /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#getContact}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|getContact}. * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService * @typedef GetContactCallback * @type {function} @@ -275,7 +275,7 @@ */ /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#deleteContact}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|deleteContact}. * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService * @typedef DeleteContactCallback * @type {function} @@ -308,7 +308,7 @@ */ /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#computeContacts}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|computeContacts}. * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService * @typedef ComputeContactsCallback * @type {function} @@ -341,7 +341,7 @@ */ /** - * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService#sendTestMessage}. + * Callback as used by {@link google.cloud.essentialcontacts.v1.EssentialContactsService|sendTestMessage}. * @memberof google.cloud.essentialcontacts.v1.EssentialContactsService * @typedef SendTestMessageCallback * @type {function} @@ -528,31 +528,37 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.email = reader.string(); - break; - case 3: - if (!(message.notificationCategorySubscriptions && message.notificationCategorySubscriptions.length)) - message.notificationCategorySubscriptions = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.email = reader.string(); + break; + } + case 3: { + if (!(message.notificationCategorySubscriptions && message.notificationCategorySubscriptions.length)) + message.notificationCategorySubscriptions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.notificationCategorySubscriptions.push(reader.int32()); + } else message.notificationCategorySubscriptions.push(reader.int32()); - } else - message.notificationCategorySubscriptions.push(reader.int32()); - break; - case 4: - message.languageTag = reader.string(); - break; - case 8: - message.validationState = reader.int32(); - break; - case 9: - message.validateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + break; + } + case 4: { + message.languageTag = reader.string(); + break; + } + case 8: { + message.validationState = reader.int32(); + break; + } + case 9: { + message.validateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -769,6 +775,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Contact + * @function getTypeUrl + * @memberof google.cloud.essentialcontacts.v1.Contact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Contact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.essentialcontacts.v1.Contact"; + }; + return Contact; })(); @@ -886,15 +907,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1001,6 +1025,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListContactsRequest + * @function getTypeUrl + * @memberof google.cloud.essentialcontacts.v1.ListContactsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListContactsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.essentialcontacts.v1.ListContactsRequest"; + }; + return ListContactsRequest; })(); @@ -1109,14 +1148,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.contacts && message.contacts.length)) - message.contacts = []; - message.contacts.push($root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push($root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1232,6 +1273,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListContactsResponse + * @function getTypeUrl + * @memberof google.cloud.essentialcontacts.v1.ListContactsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListContactsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.essentialcontacts.v1.ListContactsResponse"; + }; + return ListContactsResponse; })(); @@ -1327,9 +1383,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; @@ -1419,6 +1476,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetContactRequest + * @function getTypeUrl + * @memberof google.cloud.essentialcontacts.v1.GetContactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetContactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.essentialcontacts.v1.GetContactRequest"; + }; + return GetContactRequest; })(); @@ -1514,9 +1586,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; @@ -1606,6 +1679,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteContactRequest + * @function getTypeUrl + * @memberof google.cloud.essentialcontacts.v1.DeleteContactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteContactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.essentialcontacts.v1.DeleteContactRequest"; + }; + return DeleteContactRequest; })(); @@ -1712,12 +1800,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.contact = $root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.contact = $root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1821,6 +1911,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateContactRequest + * @function getTypeUrl + * @memberof google.cloud.essentialcontacts.v1.CreateContactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateContactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.essentialcontacts.v1.CreateContactRequest"; + }; + return CreateContactRequest; })(); @@ -1927,12 +2032,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.contact = $root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32()); - break; - case 3: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 2: { + message.contact = $root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2041,6 +2148,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateContactRequest + * @function getTypeUrl + * @memberof google.cloud.essentialcontacts.v1.UpdateContactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateContactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.essentialcontacts.v1.UpdateContactRequest"; + }; + return UpdateContactRequest; })(); @@ -2174,25 +2296,29 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 6: - if (!(message.notificationCategories && message.notificationCategories.length)) - message.notificationCategories = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.parent = reader.string(); + break; + } + case 6: { + if (!(message.notificationCategories && message.notificationCategories.length)) + message.notificationCategories = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.notificationCategories.push(reader.int32()); + } else message.notificationCategories.push(reader.int32()); - } else - message.notificationCategories.push(reader.int32()); - break; - case 3: - message.pageSize = reader.int32(); - break; - case 4: - message.pageToken = reader.string(); - break; + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2370,6 +2496,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ComputeContactsRequest + * @function getTypeUrl + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeContactsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.essentialcontacts.v1.ComputeContactsRequest"; + }; + return ComputeContactsRequest; })(); @@ -2478,14 +2619,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.contacts && message.contacts.length)) - message.contacts = []; - message.contacts.push($root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push($root.google.cloud.essentialcontacts.v1.Contact.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2601,6 +2744,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ComputeContactsResponse + * @function getTypeUrl + * @memberof google.cloud.essentialcontacts.v1.ComputeContactsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeContactsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.essentialcontacts.v1.ComputeContactsResponse"; + }; + return ComputeContactsResponse; })(); @@ -2720,17 +2878,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.contacts && message.contacts.length)) - message.contacts = []; - message.contacts.push(reader.string()); - break; - case 2: - message.resource = reader.string(); - break; - case 3: - message.notificationCategory = reader.int32(); - break; + case 1: { + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push(reader.string()); + break; + } + case 2: { + message.resource = reader.string(); + break; + } + case 3: { + message.notificationCategory = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2898,6 +3059,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SendTestMessageRequest + * @function getTypeUrl + * @memberof google.cloud.essentialcontacts.v1.SendTestMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SendTestMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.essentialcontacts.v1.SendTestMessageRequest"; + }; + return SendTestMessageRequest; })(); @@ -3024,14 +3200,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; @@ -3147,6 +3325,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; })(); @@ -3357,38 +3550,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; @@ -3610,6 +3813,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; })(); @@ -3716,12 +3934,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; @@ -3820,12 +4040,27 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior + /** + * 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; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value @@ -4014,36 +4249,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; @@ -4241,6 +4483,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 @@ -4377,12 +4634,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; @@ -4481,6 +4740,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; })(); @@ -4590,11 +4864,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; @@ -4701,6 +4976,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; })(); @@ -4722,6 +5012,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 */ /** @@ -4842,6 +5133,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 @@ -4897,6 +5196,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; }; @@ -4931,66 +5232,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; @@ -5102,6 +5419,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; }; @@ -5194,6 +5514,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -5225,6 +5547,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -5271,6 +5594,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; }; @@ -5285,6 +5610,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; })(); @@ -5495,52 +5835,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; @@ -5841,6 +6191,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() { /** @@ -5955,15 +6320,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; @@ -6075,6 +6443,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; })(); @@ -6181,12 +6564,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; @@ -6285,6 +6670,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; })(); @@ -6385,11 +6785,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; @@ -6496,6 +6897,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; })(); @@ -6701,39 +7117,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; @@ -7020,6 +7447,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 @@ -7188,12 +7630,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; @@ -7297,6 +7741,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; })(); @@ -7442,27 +7901,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; @@ -7638,6 +8102,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() { /** @@ -7741,12 +8220,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; @@ -7845,6 +8326,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; })(); @@ -7965,15 +8461,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; @@ -8085,6 +8584,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; })(); @@ -8204,17 +8718,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; @@ -8344,6 +8861,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + return ServiceDescriptorProto; })(); @@ -8494,24 +9026,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; @@ -8647,6 +9185,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; })(); @@ -8977,76 +9530,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; @@ -9359,6 +9934,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 @@ -9527,26 +10117,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; @@ -9700,6 +10296,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; })(); @@ -9713,6 +10324,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 @@ -9769,6 +10381,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -9845,6 +10465,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(); @@ -9890,42 +10512,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; @@ -9985,6 +10620,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"; @@ -10070,6 +10708,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) @@ -10157,6 +10797,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")) @@ -10171,6 +10812,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) @@ -10197,6 +10840,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 @@ -10326,11 +10984,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; @@ -10437,6 +11096,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; })(); @@ -10556,17 +11230,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; @@ -10691,6 +11368,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; })(); @@ -10799,14 +11491,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; @@ -10922,6 +11616,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; })(); @@ -11052,20 +11761,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; @@ -11198,6 +11911,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; })(); @@ -11341,25 +12069,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; @@ -11536,6 +12269,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 @@ -11715,29 +12463,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; @@ -11850,7 +12605,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); @@ -11931,6 +12686,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() { /** @@ -12032,12 +12802,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; @@ -12138,6 +12910,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; })(); @@ -12238,11 +13025,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; @@ -12349,6 +13137,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() { /** @@ -12497,37 +13300,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; @@ -12688,6 +13496,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; })(); @@ -12788,11 +13611,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; @@ -12899,6 +13723,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() { /** @@ -12909,6 +13748,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 */ /** @@ -12959,6 +13799,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 @@ -12995,6 +13843,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; }; @@ -13029,25 +13879,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; @@ -13099,6 +13957,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; }; @@ -13127,6 +13994,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; }; @@ -13149,6 +14030,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -13161,6 +14043,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; }; @@ -13175,6 +14059,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; })(); @@ -13338,6 +14253,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + return Empty; })(); @@ -13435,11 +14365,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; @@ -13541,6 +14472,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; })(); @@ -13647,12 +14593,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; @@ -13765,6 +14713,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + return Timestamp; })(); diff --git a/packages/google-cloud-essentialcontacts/protos/protos.json b/packages/google-cloud-essentialcontacts/protos/protos.json index 9dcf2f0a2b4..8c722dcdd1f 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.json +++ b/packages/google-cloud-essentialcontacts/protos/protos.json @@ -744,6 +744,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -1272,6 +1276,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -1564,6 +1575,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From 2a2b8309fb4cdde6205db3d3478a32c3285a961e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 27 Aug 2022 05:00:41 +0000 Subject: [PATCH 57/69] fix: do not import the whole google-gax from proto JS (#1553) (#109) 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-essentialcontacts/package.json | 2 +- packages/google-cloud-essentialcontacts/protos/protos.d.ts | 2 +- packages/google-cloud-essentialcontacts/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index f9ad8ddbc3e..37525bb4c3d 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-essentialcontacts/protos/protos.d.ts b/packages/google-cloud-essentialcontacts/protos/protos.d.ts index d46ca1a9db4..1a2056da261 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.d.ts +++ b/packages/google-cloud-essentialcontacts/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-essentialcontacts/protos/protos.js b/packages/google-cloud-essentialcontacts/protos/protos.js index 98bc6ffc303..fd0de7a3e81 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.js +++ b/packages/google-cloud-essentialcontacts/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 c8de42878ca0e13f6dc69a55679630cbd897eb96 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 20:48:11 +0000 Subject: [PATCH 58/69] fix: allow passing gax instance to client constructor (#110) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 470911839 Source-Link: https://github.com/googleapis/googleapis/commit/352756699ebc5b2144c252867c265ea44448712e Source-Link: https://github.com/googleapis/googleapis-gen/commit/f16a1d224f00a630ea43d6a9a1a31f566f45cdea Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE2YTFkMjI0ZjAwYTYzMGVhNDNkNmE5YTFhMzFmNTY2ZjQ1Y2RlYSJ9 feat: accept google-gax instance as a parameter Please see the documentation of the client constructor for details. PiperOrigin-RevId: 470332808 Source-Link: https://github.com/googleapis/googleapis/commit/d4a23675457cd8f0b44080e0594ec72de1291b89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e97a1ac204ead4fe7341f91e72db7c6ac6016341 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTk3YTFhYzIwNGVhZDRmZTczNDFmOTFlNzJkYjdjNmFjNjAxNjM0MSJ9 --- .../v1/essential_contacts_service_client.ts | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts index 3ee4db18c05..23bc15fc448 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -26,7 +26,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -36,7 +35,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './essential_contacts_service_client_config.json'; - const version = require('../../../package.json').version; /** @@ -96,8 +94,18 @@ export class EssentialContactsServiceClient { * 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 EssentialContactsServiceClient({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 EssentialContactsServiceClient; @@ -118,8 +126,13 @@ export class EssentialContactsServiceClient { 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); @@ -207,7 +220,7 @@ export class EssentialContactsServiceClient { 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; } /** @@ -430,7 +443,7 @@ export class EssentialContactsServiceClient { 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(); @@ -533,7 +546,7 @@ export class EssentialContactsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'contact.name': request.contact!.name || '', }); this.initialize(); @@ -627,7 +640,7 @@ export class EssentialContactsServiceClient { 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(); @@ -727,7 +740,7 @@ export class EssentialContactsServiceClient { 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(); @@ -837,7 +850,7 @@ export class EssentialContactsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -944,7 +957,7 @@ export class EssentialContactsServiceClient { 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(); @@ -990,7 +1003,7 @@ export class EssentialContactsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listContacts']; @@ -1045,7 +1058,7 @@ export class EssentialContactsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listContacts']; @@ -1163,7 +1176,7 @@ export class EssentialContactsServiceClient { 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(); @@ -1213,7 +1226,7 @@ export class EssentialContactsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['computeContacts']; @@ -1272,7 +1285,7 @@ export class EssentialContactsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['computeContacts']; From 07c74bc5c4b20f63153a78d9d72d5d74b8c9da2f 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:26 +0000 Subject: [PATCH 59/69] fix: preserve default values in x-goog-request-params header (#111) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 474338479 Source-Link: https://github.com/googleapis/googleapis/commit/d5d35e0353b59719e8917103b1bc7df2782bf6ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/efcd3f93962a103f68f003e2a1eecde6fa216a27 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9 --- .../v1/essential_contacts_service_client.ts | 22 +- .../gapic_essential_contacts_service_v1.ts | 755 +++++++++--------- 2 files changed, 407 insertions(+), 370 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts index 23bc15fc448..acd14182531 100644 --- a/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts +++ b/packages/google-cloud-essentialcontacts/src/v1/essential_contacts_service_client.ts @@ -444,7 +444,7 @@ export class EssentialContactsServiceClient { 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.createContact(request, options, callback); @@ -547,7 +547,7 @@ export class EssentialContactsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'contact.name': request.contact!.name || '', + 'contact.name': request.contact!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateContact(request, options, callback); @@ -641,7 +641,7 @@ export class EssentialContactsServiceClient { 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.getContact(request, options, callback); @@ -741,7 +741,7 @@ export class EssentialContactsServiceClient { 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.deleteContact(request, options, callback); @@ -851,7 +851,7 @@ export class EssentialContactsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.sendTestMessage(request, options, callback); @@ -958,7 +958,7 @@ export class EssentialContactsServiceClient { 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.listContacts(request, options, callback); @@ -1004,7 +1004,7 @@ export class EssentialContactsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listContacts']; const callSettings = defaultCallSettings.merge(options); @@ -1059,7 +1059,7 @@ export class EssentialContactsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listContacts']; const callSettings = defaultCallSettings.merge(options); @@ -1177,7 +1177,7 @@ export class EssentialContactsServiceClient { 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.computeContacts(request, options, callback); @@ -1227,7 +1227,7 @@ export class EssentialContactsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['computeContacts']; const callSettings = defaultCallSettings.merge(options); @@ -1286,7 +1286,7 @@ export class EssentialContactsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['computeContacts']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts index 07484d87cbf..933bd4a3329 100644 --- a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts +++ b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -233,26 +248,25 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateContactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() ); client.innerApiCalls.createContact = stubSimpleCall(expectedResponse); const [response] = await client.createContact(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createContact without error using callback', async () => { @@ -265,15 +279,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateContactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() ); @@ -296,11 +306,14 @@ describe('v1.EssentialContactsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createContact with error', async () => { @@ -313,26 +326,25 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateContactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createContact = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createContact(request), expectedError); - assert( - (client.innerApiCalls.createContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createContact with closed client', async () => { @@ -345,7 +357,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateContactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createContact(request), expectedError); @@ -363,27 +378,27 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() ); - request.contact = {}; - request.contact.name = ''; - const expectedHeaderRequestParams = 'contact.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.contact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContactRequest', [ + 'contact', + 'name', + ]); + request.contact.name = defaultValue1; + const expectedHeaderRequestParams = `contact.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() ); client.innerApiCalls.updateContact = stubSimpleCall(expectedResponse); const [response] = await client.updateContact(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateContact without error using callback', async () => { @@ -396,16 +411,13 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() ); - request.contact = {}; - request.contact.name = ''; - const expectedHeaderRequestParams = 'contact.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.contact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContactRequest', [ + 'contact', + 'name', + ]); + request.contact.name = defaultValue1; + const expectedHeaderRequestParams = `contact.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() ); @@ -428,11 +440,14 @@ describe('v1.EssentialContactsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateContact with error', async () => { @@ -445,27 +460,27 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() ); - request.contact = {}; - request.contact.name = ''; - const expectedHeaderRequestParams = 'contact.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.contact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContactRequest', [ + 'contact', + 'name', + ]); + request.contact.name = defaultValue1; + const expectedHeaderRequestParams = `contact.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateContact = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateContact(request), expectedError); - assert( - (client.innerApiCalls.updateContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateContact with closed client', async () => { @@ -478,8 +493,12 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() ); - request.contact = {}; - request.contact.name = ''; + request.contact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContactRequest', [ + 'contact', + 'name', + ]); + request.contact.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateContact(request), expectedError); @@ -497,26 +516,23 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.GetContactRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetContactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() ); client.innerApiCalls.getContact = stubSimpleCall(expectedResponse); const [response] = await client.getContact(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getContact without error using callback', async () => { @@ -529,15 +545,9 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.GetContactRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetContactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() ); @@ -560,11 +570,14 @@ describe('v1.EssentialContactsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getContact with error', async () => { @@ -577,26 +590,23 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.GetContactRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetContactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getContact = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getContact(request), expectedError); - assert( - (client.innerApiCalls.getContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getContact with closed client', async () => { @@ -609,7 +619,8 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.GetContactRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetContactRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getContact(request), expectedError); @@ -627,26 +638,25 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteContactRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteContact = stubSimpleCall(expectedResponse); const [response] = await client.deleteContact(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteContact without error using callback', async () => { @@ -659,15 +669,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteContactRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -690,11 +696,14 @@ describe('v1.EssentialContactsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteContact with error', async () => { @@ -707,26 +716,25 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteContactRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteContact = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteContact(request), expectedError); - assert( - (client.innerApiCalls.deleteContact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteContact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteContact with closed client', async () => { @@ -739,7 +747,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteContactRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteContact(request), expectedError); @@ -757,26 +768,25 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SendTestMessageRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.sendTestMessage = stubSimpleCall(expectedResponse); const [response] = await client.sendTestMessage(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.sendTestMessage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.sendTestMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.sendTestMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes sendTestMessage without error using callback', async () => { @@ -789,15 +799,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SendTestMessageRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -820,11 +826,14 @@ describe('v1.EssentialContactsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.sendTestMessage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.sendTestMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.sendTestMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes sendTestMessage with error', async () => { @@ -837,26 +846,25 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SendTestMessageRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.sendTestMessage = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.sendTestMessage(request), expectedError); - assert( - (client.innerApiCalls.sendTestMessage as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.sendTestMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.sendTestMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes sendTestMessage with closed client', async () => { @@ -869,7 +877,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('SendTestMessageRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.sendTestMessage(request), expectedError); @@ -887,15 +898,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() @@ -910,11 +917,14 @@ describe('v1.EssentialContactsServiceClient', () => { client.innerApiCalls.listContacts = stubSimpleCall(expectedResponse); const [response] = await client.listContacts(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listContacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listContacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listContacts without error using callback', async () => { @@ -927,15 +937,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() @@ -966,11 +972,14 @@ describe('v1.EssentialContactsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listContacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listContacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listContacts with error', async () => { @@ -983,26 +992,25 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listContacts = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listContacts(request), expectedError); - assert( - (client.innerApiCalls.listContacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listContacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listContactsStream without error', async () => { @@ -1015,8 +1023,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() @@ -1054,11 +1065,12 @@ describe('v1.EssentialContactsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listContacts, request) ); - assert.strictEqual( - ( - client.descriptors.page.listContacts.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listContacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1072,8 +1084,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listContacts.createStream = stubPageStreamingCall( undefined, @@ -1102,11 +1117,12 @@ describe('v1.EssentialContactsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listContacts, request) ); - assert.strictEqual( - ( - client.descriptors.page.listContacts.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listContacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1120,8 +1136,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() @@ -1147,11 +1166,12 @@ describe('v1.EssentialContactsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listContacts.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listContacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1165,8 +1185,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listContacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1184,11 +1207,12 @@ describe('v1.EssentialContactsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listContacts.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listContacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1204,15 +1228,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() @@ -1227,11 +1247,14 @@ describe('v1.EssentialContactsServiceClient', () => { client.innerApiCalls.computeContacts = stubSimpleCall(expectedResponse); const [response] = await client.computeContacts(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.computeContacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.computeContacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.computeContacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes computeContacts without error using callback', async () => { @@ -1244,15 +1267,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() @@ -1283,11 +1302,14 @@ describe('v1.EssentialContactsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.computeContacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.computeContacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.computeContacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes computeContacts with error', async () => { @@ -1300,26 +1322,25 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.computeContacts = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.computeContacts(request), expectedError); - assert( - (client.innerApiCalls.computeContacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.computeContacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.computeContacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes computeContactsStream without error', async () => { @@ -1332,8 +1353,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() @@ -1371,11 +1395,12 @@ describe('v1.EssentialContactsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.computeContacts, request) ); - assert.strictEqual( - ( - client.descriptors.page.computeContacts.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.computeContacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1389,8 +1414,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.computeContacts.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1417,11 +1445,12 @@ describe('v1.EssentialContactsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.computeContacts, request) ); - assert.strictEqual( - ( - client.descriptors.page.computeContacts.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.computeContacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1435,8 +1464,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.Contact() @@ -1462,11 +1494,12 @@ describe('v1.EssentialContactsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.computeContacts.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.computeContacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1480,8 +1513,11 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.computeContacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1499,11 +1535,12 @@ describe('v1.EssentialContactsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.computeContacts.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.computeContacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); From 16add83c0a24c10f288e42bddeac318edc0554ca 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:28:19 -0700 Subject: [PATCH 60/69] test: use fully qualified request type name in tests (#113) 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_essential_contacts_service_v1.ts | 234 ++++++++++-------- 1 file changed, 136 insertions(+), 98 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts index 933bd4a3329..bc1d4c5efcb 100644 --- a/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts +++ b/packages/google-cloud-essentialcontacts/test/gapic_essential_contacts_service_v1.ts @@ -248,9 +248,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateContactRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.CreateContactRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -279,9 +280,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateContactRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.CreateContactRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -326,9 +328,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateContactRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.CreateContactRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -357,9 +360,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.CreateContactRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateContactRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.CreateContactRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -379,10 +383,10 @@ describe('v1.EssentialContactsServiceClient', () => { new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() ); request.contact ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateContactRequest', [ - 'contact', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.UpdateContactRequest', + ['contact', 'name'] + ); request.contact.name = defaultValue1; const expectedHeaderRequestParams = `contact.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -412,10 +416,10 @@ describe('v1.EssentialContactsServiceClient', () => { new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() ); request.contact ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateContactRequest', [ - 'contact', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.UpdateContactRequest', + ['contact', 'name'] + ); request.contact.name = defaultValue1; const expectedHeaderRequestParams = `contact.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -461,10 +465,10 @@ describe('v1.EssentialContactsServiceClient', () => { new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() ); request.contact ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateContactRequest', [ - 'contact', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.UpdateContactRequest', + ['contact', 'name'] + ); request.contact.name = defaultValue1; const expectedHeaderRequestParams = `contact.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -494,10 +498,10 @@ describe('v1.EssentialContactsServiceClient', () => { new protos.google.cloud.essentialcontacts.v1.UpdateContactRequest() ); request.contact ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateContactRequest', [ - 'contact', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.UpdateContactRequest', + ['contact', 'name'] + ); request.contact.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -516,7 +520,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.GetContactRequest() ); - const defaultValue1 = getTypeDefaultValue('GetContactRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.GetContactRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -545,7 +552,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.GetContactRequest() ); - const defaultValue1 = getTypeDefaultValue('GetContactRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.GetContactRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -590,7 +600,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.GetContactRequest() ); - const defaultValue1 = getTypeDefaultValue('GetContactRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.GetContactRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -619,7 +632,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.GetContactRequest() ); - const defaultValue1 = getTypeDefaultValue('GetContactRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.GetContactRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -638,9 +654,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteContactRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.DeleteContactRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -669,9 +686,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteContactRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.DeleteContactRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -716,9 +734,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteContactRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.DeleteContactRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -747,9 +766,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.DeleteContactRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteContactRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.DeleteContactRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -768,9 +788,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() ); - const defaultValue1 = getTypeDefaultValue('SendTestMessageRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.SendTestMessageRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -799,9 +820,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() ); - const defaultValue1 = getTypeDefaultValue('SendTestMessageRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.SendTestMessageRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -846,9 +868,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() ); - const defaultValue1 = getTypeDefaultValue('SendTestMessageRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.SendTestMessageRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -877,9 +900,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.SendTestMessageRequest() ); - const defaultValue1 = getTypeDefaultValue('SendTestMessageRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.SendTestMessageRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -898,9 +922,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ListContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -937,9 +962,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ListContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -992,9 +1018,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ListContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1023,9 +1050,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ListContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1084,9 +1112,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ListContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1136,9 +1165,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ListContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1185,9 +1215,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ListContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ListContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1228,9 +1259,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ComputeContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1267,9 +1299,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ComputeContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1322,9 +1355,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ComputeContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1353,9 +1387,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ComputeContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1414,9 +1449,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ComputeContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1464,9 +1500,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ComputeContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1513,9 +1550,10 @@ describe('v1.EssentialContactsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.essentialcontacts.v1.ComputeContactsRequest() ); - const defaultValue1 = getTypeDefaultValue('ComputeContactsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.essentialcontacts.v1.ComputeContactsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); From dba96730b8db6dda43216e496f6252fcf62e5621 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 Nov 2022 23:41:52 -0700 Subject: [PATCH 61/69] fix(deps): use google-gax v3.5.2 (#117) --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 37525bb4c3d..7033b7c4b75 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^3.3.0" + "google-gax": "^3.5.2" }, "devDependencies": { "@types/mocha": "^9.0.0", From b8b4d60fab78953295ff32cfac849a29d44b3ddc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 10:20:24 +0100 Subject: [PATCH 62/69] chore(deps): update dependency @types/node to v18 (#115) 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-essential-contacts). --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 7033b7c4b75..bac4bbc9a77 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "c8": "^7.7.2", "gts": "^3.1.0", From 78ed6b5ade913c33f06b40e1ce646195da6263c5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 10:32:15 +0000 Subject: [PATCH 63/69] fix: regenerated protos JS and TS definitions (#120) samples: pull in latest typeless bot, clean up some comments Source-Link: https://togithub.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e --- .../protos/protos.d.ts | 2 +- .../protos/protos.js | 104 +++++++++++++++--- 2 files changed, 91 insertions(+), 15 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/protos/protos.d.ts b/packages/google-cloud-essentialcontacts/protos/protos.d.ts index 1a2056da261..3ac7665bbaf 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.d.ts +++ b/packages/google-cloud-essentialcontacts/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-essentialcontacts/protos/protos.js b/packages/google-cloud-essentialcontacts/protos/protos.js index fd0de7a3e81..02e01b378d2 100644 --- a/packages/google-cloud-essentialcontacts/protos/protos.js +++ b/packages/google-cloud-essentialcontacts/protos/protos.js @@ -662,6 +662,10 @@ for (var i = 0; i < object.notificationCategorySubscriptions.length; ++i) switch (object.notificationCategorySubscriptions[i]) { default: + if (typeof object.notificationCategorySubscriptions[i] === "number") { + message.notificationCategorySubscriptions[i] = object.notificationCategorySubscriptions[i]; + break; + } case "NOTIFICATION_CATEGORY_UNSPECIFIED": case 0: message.notificationCategorySubscriptions[i] = 0; @@ -703,6 +707,12 @@ if (object.languageTag != null) message.languageTag = String(object.languageTag); switch (object.validationState) { + default: + if (typeof object.validationState === "number") { + message.validationState = object.validationState; + break; + } + break; case "VALIDATION_STATE_UNSPECIFIED": case 0: message.validationState = 0; @@ -753,12 +763,12 @@ if (message.notificationCategorySubscriptions && message.notificationCategorySubscriptions.length) { object.notificationCategorySubscriptions = []; for (var j = 0; j < message.notificationCategorySubscriptions.length; ++j) - object.notificationCategorySubscriptions[j] = options.enums === String ? $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategorySubscriptions[j]] : message.notificationCategorySubscriptions[j]; + object.notificationCategorySubscriptions[j] = options.enums === String ? $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategorySubscriptions[j]] === undefined ? message.notificationCategorySubscriptions[j] : $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategorySubscriptions[j]] : message.notificationCategorySubscriptions[j]; } if (message.languageTag != null && message.hasOwnProperty("languageTag")) object.languageTag = message.languageTag; if (message.validationState != null && message.hasOwnProperty("validationState")) - object.validationState = options.enums === String ? $root.google.cloud.essentialcontacts.v1.ValidationState[message.validationState] : message.validationState; + object.validationState = options.enums === String ? $root.google.cloud.essentialcontacts.v1.ValidationState[message.validationState] === undefined ? message.validationState : $root.google.cloud.essentialcontacts.v1.ValidationState[message.validationState] : message.validationState; if (message.validateTime != null && message.hasOwnProperty("validateTime")) object.validateTime = $root.google.protobuf.Timestamp.toObject(message.validateTime, options); return object; @@ -2406,6 +2416,10 @@ for (var i = 0; i < object.notificationCategories.length; ++i) switch (object.notificationCategories[i]) { default: + if (typeof object.notificationCategories[i] === "number") { + message.notificationCategories[i] = object.notificationCategories[i]; + break; + } case "NOTIFICATION_CATEGORY_UNSPECIFIED": case 0: message.notificationCategories[i] = 0; @@ -2480,7 +2494,7 @@ if (message.notificationCategories && message.notificationCategories.length) { object.notificationCategories = []; for (var j = 0; j < message.notificationCategories.length; ++j) - object.notificationCategories[j] = options.enums === String ? $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategories[j]] : message.notificationCategories[j]; + object.notificationCategories[j] = options.enums === String ? $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategories[j]] === undefined ? message.notificationCategories[j] : $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategories[j]] : message.notificationCategories[j]; } return object; }; @@ -2977,6 +2991,12 @@ if (object.resource != null) message.resource = String(object.resource); switch (object.notificationCategory) { + default: + if (typeof object.notificationCategory === "number") { + message.notificationCategory = object.notificationCategory; + break; + } + break; case "NOTIFICATION_CATEGORY_UNSPECIFIED": case 0: message.notificationCategory = 0; @@ -3044,7 +3064,7 @@ if (message.resource != null && message.hasOwnProperty("resource")) object.resource = message.resource; if (message.notificationCategory != null && message.hasOwnProperty("notificationCategory")) - object.notificationCategory = options.enums === String ? $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategory] : message.notificationCategory; + object.notificationCategory = options.enums === String ? $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategory] === undefined ? message.notificationCategory : $root.google.cloud.essentialcontacts.v1.NotificationCategory[message.notificationCategory] : message.notificationCategory; return object; }; @@ -4388,6 +4408,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; @@ -4412,6 +4438,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; @@ -4459,7 +4489,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")) @@ -4467,7 +4497,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; }; @@ -7278,6 +7308,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; @@ -7292,6 +7328,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; @@ -7418,9 +7460,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")) @@ -9767,6 +9809,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; @@ -9875,7 +9923,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")) @@ -10677,6 +10725,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; @@ -10693,6 +10747,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; @@ -10731,6 +10791,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; @@ -10801,7 +10865,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")) @@ -10809,7 +10873,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")) @@ -10822,7 +10886,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); @@ -12179,6 +12243,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; @@ -12242,7 +12312,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) @@ -13995,6 +14065,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; @@ -14044,7 +14120,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 eafb4b45f0b7ffd90715606b2a1deff54918fbcd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 11 Nov 2022 19:40:03 +0100 Subject: [PATCH 64/69] chore(deps): update dependency jsdoc to v4 (#119) --- packages/google-cloud-essentialcontacts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index bac4bbc9a77..6b3dc6bb0c2 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -47,7 +47,7 @@ "@types/sinon": "^10.0.0", "c8": "^7.7.2", "gts": "^3.1.0", - "jsdoc": "^3.6.6", + "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^4.0.0", From 67b7d53ab0e271227bfe6ffd8a4abfec74f6c5ff Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 18:44:14 +0000 Subject: [PATCH 65/69] chore(main): release 2.0.2 (#107) :robot: I have created a release *beep* *boop* --- ## [2.0.2](https://togithub.com/googleapis/nodejs-essential-contacts/compare/v2.0.1...v2.0.2) (2022-11-11) ### Bug Fixes * Allow passing gax instance to client constructor ([#110](https://togithub.com/googleapis/nodejs-essential-contacts/issues/110)) ([fb3d596](https://togithub.com/googleapis/nodejs-essential-contacts/commit/fb3d596a8dee0ab338485a862955757cfbcd99c2)) * Better support for fallback mode ([#105](https://togithub.com/googleapis/nodejs-essential-contacts/issues/105)) ([c23259b](https://togithub.com/googleapis/nodejs-essential-contacts/commit/c23259b0a493e5bcdabf408902ffe16be76e7cb0)) * Change import long to require ([#106](https://togithub.com/googleapis/nodejs-essential-contacts/issues/106)) ([f009752](https://togithub.com/googleapis/nodejs-essential-contacts/commit/f009752ac7a8267ef6444fa9eb7338e70e6687d6)) * **deps:** Use google-gax v3.5.2 ([#117](https://togithub.com/googleapis/nodejs-essential-contacts/issues/117)) ([f90a6e7](https://togithub.com/googleapis/nodejs-essential-contacts/commit/f90a6e75af5c23754bf67bea1b8fd55c96a1330f)) * Do not import the whole google-gax from proto JS ([#1553](https://togithub.com/googleapis/nodejs-essential-contacts/issues/1553)) ([#109](https://togithub.com/googleapis/nodejs-essential-contacts/issues/109)) ([c7e8827](https://togithub.com/googleapis/nodejs-essential-contacts/commit/c7e8827859caa1c23bc38f43ca71cfe8d6784dfd)) * Preserve default values in x-goog-request-params header ([#111](https://togithub.com/googleapis/nodejs-essential-contacts/issues/111)) ([5074ba2](https://togithub.com/googleapis/nodejs-essential-contacts/commit/5074ba241d3e5ac5dc4a47ef7fc9cc3761f406cb)) * Regenerated protos JS and TS definitions ([#120](https://togithub.com/googleapis/nodejs-essential-contacts/issues/120)) ([4989df1](https://togithub.com/googleapis/nodejs-essential-contacts/commit/4989df17b1c7d0deb7907f7659b0fd2032833e8f)) * Remove pip install statements ([#1546](https://togithub.com/googleapis/nodejs-essential-contacts/issues/1546)) ([#108](https://togithub.com/googleapis/nodejs-essential-contacts/issues/108)) ([9fb4d1c](https://togithub.com/googleapis/nodejs-essential-contacts/commit/9fb4d1c253480086fe101cef0817874b313d076a)) * use google-gax v3.3.0 ([c7e8827](https://togithub.com/googleapis/nodejs-essential-contacts/commit/c7e8827859caa1c23bc38f43ca71cfe8d6784dfd)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- .../google-cloud-essentialcontacts/CHANGELOG.md | 15 +++++++++++++++ .../google-cloud-essentialcontacts/package.json | 2 +- ...etadata.google.cloud.essentialcontacts.v1.json | 2 +- .../samples/package.json | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/CHANGELOG.md b/packages/google-cloud-essentialcontacts/CHANGELOG.md index 840e12fbc17..f1da1cccf5b 100644 --- a/packages/google-cloud-essentialcontacts/CHANGELOG.md +++ b/packages/google-cloud-essentialcontacts/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.0.2](https://github.com/googleapis/nodejs-essential-contacts/compare/v2.0.1...v2.0.2) (2022-11-11) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#110](https://github.com/googleapis/nodejs-essential-contacts/issues/110)) ([fb3d596](https://github.com/googleapis/nodejs-essential-contacts/commit/fb3d596a8dee0ab338485a862955757cfbcd99c2)) +* Better support for fallback mode ([#105](https://github.com/googleapis/nodejs-essential-contacts/issues/105)) ([c23259b](https://github.com/googleapis/nodejs-essential-contacts/commit/c23259b0a493e5bcdabf408902ffe16be76e7cb0)) +* Change import long to require ([#106](https://github.com/googleapis/nodejs-essential-contacts/issues/106)) ([f009752](https://github.com/googleapis/nodejs-essential-contacts/commit/f009752ac7a8267ef6444fa9eb7338e70e6687d6)) +* **deps:** Use google-gax v3.5.2 ([#117](https://github.com/googleapis/nodejs-essential-contacts/issues/117)) ([f90a6e7](https://github.com/googleapis/nodejs-essential-contacts/commit/f90a6e75af5c23754bf67bea1b8fd55c96a1330f)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-essential-contacts/issues/1553)) ([#109](https://github.com/googleapis/nodejs-essential-contacts/issues/109)) ([c7e8827](https://github.com/googleapis/nodejs-essential-contacts/commit/c7e8827859caa1c23bc38f43ca71cfe8d6784dfd)) +* Preserve default values in x-goog-request-params header ([#111](https://github.com/googleapis/nodejs-essential-contacts/issues/111)) ([5074ba2](https://github.com/googleapis/nodejs-essential-contacts/commit/5074ba241d3e5ac5dc4a47ef7fc9cc3761f406cb)) +* Regenerated protos JS and TS definitions ([#120](https://github.com/googleapis/nodejs-essential-contacts/issues/120)) ([4989df1](https://github.com/googleapis/nodejs-essential-contacts/commit/4989df17b1c7d0deb7907f7659b0fd2032833e8f)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-essential-contacts/issues/1546)) ([#108](https://github.com/googleapis/nodejs-essential-contacts/issues/108)) ([9fb4d1c](https://github.com/googleapis/nodejs-essential-contacts/commit/9fb4d1c253480086fe101cef0817874b313d076a)) +* use google-gax v3.3.0 ([c7e8827](https://github.com/googleapis/nodejs-essential-contacts/commit/c7e8827859caa1c23bc38f43ca71cfe8d6784dfd)) + ## [2.0.1](https://github.com/googleapis/nodejs-essential-contacts/compare/v2.0.0...v2.0.1) (2022-06-30) diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 6b3dc6bb0c2..78f071b8074 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/essential-contacts", - "version": "2.0.1", + "version": "2.0.2", "description": "Essential contacts client for Node.js", "repository": "googleapis/nodejs-essential-contacts", "license": "Apache-2.0", diff --git a/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json index 9613365be0b..1644f7f8559 100644 --- a/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json +++ b/packages/google-cloud-essentialcontacts/samples/generated/v1/snippet_metadata.google.cloud.essentialcontacts.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-essentialcontacts", - "version": "2.0.1", + "version": "2.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-essentialcontacts/samples/package.json b/packages/google-cloud-essentialcontacts/samples/package.json index 2b969d94266..6e3a9dfffdc 100644 --- a/packages/google-cloud-essentialcontacts/samples/package.json +++ b/packages/google-cloud-essentialcontacts/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/essential-contacts": "^2.0.1" + "@google-cloud/essential-contacts": "^2.0.2" }, "devDependencies": { "c8": "^7.1.0", From c2153aa9c4dd43230796001b8cee091c1b567843 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Fri, 11 Nov 2022 11:19:21 -0800 Subject: [PATCH 66/69] build: add release-please config, fix owlbot-config --- .release-please-manifest.json | 1 + .../{.github => }/.OwlBot.yaml | 6 +- .../.mocharc.js | 2 +- .../.prettierrc.js | 2 +- .../.repo-metadata.json | 4 +- .../google-cloud-essentialcontacts/README.md | 21 ++- .../package.json | 13 +- .../samples/README.md | 138 +++++++++++++++++- .../src/index.ts | 2 +- release-please-config.json | 3 +- 10 files changed, 165 insertions(+), 27 deletions(-) rename packages/google-cloud-essentialcontacts/{.github => }/.OwlBot.yaml (78%) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c38b0a70276..eadfa61d836 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -18,6 +18,7 @@ "packages/google-cloud-dataproc": "4.1.1", "packages/google-cloud-deploy": "2.2.2", "packages/google-cloud-discoveryengine": "0.2.0", + "packages/google-cloud-essentialcontacts": "2.0.2", "packages/google-cloud-gkeconnect-gateway": "2.0.5", "packages/google-cloud-gkemulticloud": "0.1.4", "packages/google-cloud-language": "5.1.2", diff --git a/packages/google-cloud-essentialcontacts/.github/.OwlBot.yaml b/packages/google-cloud-essentialcontacts/.OwlBot.yaml similarity index 78% rename from packages/google-cloud-essentialcontacts/.github/.OwlBot.yaml rename to packages/google-cloud-essentialcontacts/.OwlBot.yaml index f84e2f5414d..424ed4e3b64 100644 --- a/packages/google-cloud-essentialcontacts/.github/.OwlBot.yaml +++ b/packages/google-cloud-essentialcontacts/.OwlBot.yaml @@ -11,12 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest deep-remove-regex: - /owl-bot-staging deep-copy-regex: - - source: /google/cloud/essentialcontacts/(.*)/.*-nodejs/(.*) - dest: /owl-bot-staging/$1/$2 + - source: /google/cloud/essentialcontacts/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-essentialcontacts/$1 diff --git a/packages/google-cloud-essentialcontacts/.mocharc.js b/packages/google-cloud-essentialcontacts/.mocharc.js index 0b600509bed..cdb7b752160 100644 --- a/packages/google-cloud-essentialcontacts/.mocharc.js +++ b/packages/google-cloud-essentialcontacts/.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-essentialcontacts/.prettierrc.js b/packages/google-cloud-essentialcontacts/.prettierrc.js index d1b95106f4c..d546a4ad546 100644 --- a/packages/google-cloud-essentialcontacts/.prettierrc.js +++ b/packages/google-cloud-essentialcontacts/.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-essentialcontacts/.repo-metadata.json b/packages/google-cloud-essentialcontacts/.repo-metadata.json index e3d0a77ed9a..eea5641345a 100644 --- a/packages/google-cloud-essentialcontacts/.repo-metadata.json +++ b/packages/google-cloud-essentialcontacts/.repo-metadata.json @@ -7,8 +7,8 @@ "language": "nodejs", "api_id": "essentialcontacts.googleapis.com", "distribution_name": "@google-cloud/essential-contacts", - "repo": "googleapis/nodejs-essential-contacts", - "issue_tracker": "https://github.com/googleapis/nodejs-essential-contacts/issues", + "repo": "googleapis/google-cloud-node", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", "name_pretty": "Essential Contacts API", "default_version": "v1", "api_shortname": "essentialcontacts", diff --git a/packages/google-cloud-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index 8a79d9d126f..d6bf52f6201 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Essential Contacts API: Node.js Client](https://github.com/googleapis/nodejs-essential-contacts) +# [Essential Contacts API: Node.js Client](https://github.com/googleapis/google-cloud-node) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/essential-contacts.svg)](https://www.npmjs.org/package/@google-cloud/essential-contacts) @@ -14,11 +14,11 @@ Essential contacts client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-essential-contacts/blob/main/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-essentialcontacts/CHANGELOG.md). * [Essential Contacts API Node.js Client API Reference][client-docs] * [Essential Contacts API Documentation][product-docs] -* [github.com/googleapis/nodejs-essential-contacts](https://github.com/googleapis/nodejs-essential-contacts) +* [github.com/googleapis/google-cloud-node/packages/google-cloud-essentialcontacts](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-essentialcontacts) Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. @@ -84,11 +84,18 @@ listContacts(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-essential-contacts/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-essential-contacts/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-essential-contacts&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Essential_contacts_service.compute_contacts | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.compute_contacts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.compute_contacts.js,samples/README.md) | +| Essential_contacts_service.create_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.create_contact.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.create_contact.js,samples/README.md) | +| Essential_contacts_service.delete_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.delete_contact.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.delete_contact.js,samples/README.md) | +| Essential_contacts_service.get_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.get_contact.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.get_contact.js,samples/README.md) | +| Essential_contacts_service.list_contacts | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.list_contacts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.list_contacts.js,samples/README.md) | +| Essential_contacts_service.send_test_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.send_test_message.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.send_test_message.js,samples/README.md) | +| Essential_contacts_service.update_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.update_contact.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.update_contact.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) | @@ -138,7 +145,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-essential-contacts/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`) @@ -150,7 +157,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-essential-contacts/blob/main/LICENSE) +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/essential-contacts/latest [product-docs]: https://cloud.google.com/resource-manager/docs/managing-notification-contacts/ diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 78f071b8074..6a6bc295b97 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -2,7 +2,11 @@ "name": "@google-cloud/essential-contacts", "version": "2.0.2", "description": "Essential contacts client for Node.js", - "repository": "googleapis/nodejs-essential-contacts", + "repository": { + "type": "git", + "directory": "packages/google-cloud-essentialcontacts", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, "license": "Apache-2.0", "author": "Google LLC", "main": "build/src/index.js", @@ -28,14 +32,14 @@ "compile": "tsc -p . && cp -r protos build/", "compile-protos": "compileProtos src", "docs": "jsdoc -c .jsdoc.js", - "samples-test": "cd samples/ && npm link ../ && npm test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", "prelint": "cd samples; npm link ../; npm i", "predocs-test": "npm run docs", "docs-test": "linkinator docs", "fix": "gts fix", "lint": "gts check", "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", + "system-test": "npm run compile && c8 mocha build/system-test", "test": "c8 mocha build/test" }, "dependencies": { @@ -62,5 +66,6 @@ }, "engines": { "node": ">=12.0.0" - } + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-essentialcontacts" } diff --git a/packages/google-cloud-essentialcontacts/samples/README.md b/packages/google-cloud-essentialcontacts/samples/README.md index 8d254c332aa..05cb78cb7be 100644 --- a/packages/google-cloud-essentialcontacts/samples/README.md +++ b/packages/google-cloud-essentialcontacts/samples/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Essential Contacts API: Node.js Samples](https://github.com/googleapis/nodejs-essential-contacts) +# [Essential Contacts API: Node.js Samples](https://github.com/googleapis/google-cloud-node) [![Open in Cloud Shell][shell_img]][shell_link] @@ -12,12 +12,19 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Essential_contacts_service.compute_contacts](#essential_contacts_service.compute_contacts) + * [Essential_contacts_service.create_contact](#essential_contacts_service.create_contact) + * [Essential_contacts_service.delete_contact](#essential_contacts_service.delete_contact) + * [Essential_contacts_service.get_contact](#essential_contacts_service.get_contact) + * [Essential_contacts_service.list_contacts](#essential_contacts_service.list_contacts) + * [Essential_contacts_service.send_test_message](#essential_contacts_service.send_test_message) + * [Essential_contacts_service.update_contact](#essential_contacts_service.update_contact) * [Quickstart](#quickstart) ## Before you begin Before running the samples, make sure you've followed the steps outlined in -[Using the client library](https://github.com/googleapis/nodejs-essential-contacts#using-the-client-library). +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). `cd samples` @@ -29,16 +36,135 @@ Before running the samples, make sure you've followed the steps outlined in +### Essential_contacts_service.compute_contacts + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.compute_contacts.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.compute_contacts.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.compute_contacts.js` + + +----- + + + + +### Essential_contacts_service.create_contact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.create_contact.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.create_contact.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.create_contact.js` + + +----- + + + + +### Essential_contacts_service.delete_contact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.delete_contact.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.delete_contact.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.delete_contact.js` + + +----- + + + + +### Essential_contacts_service.get_contact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.get_contact.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.get_contact.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.get_contact.js` + + +----- + + + + +### Essential_contacts_service.list_contacts + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.list_contacts.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.list_contacts.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.list_contacts.js` + + +----- + + + + +### Essential_contacts_service.send_test_message + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.send_test_message.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.send_test_message.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.send_test_message.js` + + +----- + + + + +### Essential_contacts_service.update_contact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.update_contact.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.update_contact.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.update_contact.js` + + +----- + + + + ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-essential-contacts/blob/main/samples/quickstart.js). +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/nodejs-essential-contacts&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) __Usage:__ -`node samples/quickstart.js` +`node /workspace/google-cloud-node/samples/quickstart.js` @@ -46,5 +172,5 @@ __Usage:__ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-essential-contacts&page=editor&open_in_editor=samples/README.md +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md [product-docs]: https://cloud.google.com/resource-manager/docs/managing-notification-contacts/ diff --git a/packages/google-cloud-essentialcontacts/src/index.ts b/packages/google-cloud-essentialcontacts/src/index.ts index 2d6dd7c3959..a91a130e55e 100644 --- a/packages/google-cloud-essentialcontacts/src/index.ts +++ b/packages/google-cloud-essentialcontacts/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..9b1e8441fd6 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -19,6 +19,7 @@ "packages/google-cloud-dataproc": {}, "packages/google-cloud-deploy": {}, "packages/google-cloud-discoveryengine": {}, + "packages/google-cloud-essentialcontacts": {}, "packages/google-cloud-gkeconnect-gateway": {}, "packages/google-cloud-gkemulticloud": {}, "packages/google-cloud-language": {}, @@ -49,4 +50,4 @@ } ], "release-type": "node" -} \ No newline at end of file +} From 70419114e68853fd1cee0fc85e51bc2b2d4825c1 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 11 Nov 2022 19:44:31 +0000 Subject: [PATCH 67/69] =?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 --- .../google-cloud-essentialcontacts/README.md | 16 +++---- .../samples/README.md | 48 +++++++++---------- release-please-config.json | 2 +- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/packages/google-cloud-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index d6bf52f6201..19db40d9517 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -88,14 +88,14 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Essential_contacts_service.compute_contacts | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.compute_contacts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.compute_contacts.js,samples/README.md) | -| Essential_contacts_service.create_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.create_contact.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.create_contact.js,samples/README.md) | -| Essential_contacts_service.delete_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.delete_contact.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.delete_contact.js,samples/README.md) | -| Essential_contacts_service.get_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.get_contact.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.get_contact.js,samples/README.md) | -| Essential_contacts_service.list_contacts | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.list_contacts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.list_contacts.js,samples/README.md) | -| Essential_contacts_service.send_test_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.send_test_message.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.send_test_message.js,samples/README.md) | -| Essential_contacts_service.update_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.update_contact.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.update_contact.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) | +| Essential_contacts_service.compute_contacts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.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-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js,samples/README.md) | +| Essential_contacts_service.create_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js,samples/README.md) | +| Essential_contacts_service.delete_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js,samples/README.md) | +| Essential_contacts_service.get_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js,samples/README.md) | +| Essential_contacts_service.list_contacts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.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-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js,samples/README.md) | +| Essential_contacts_service.send_test_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.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-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js,samples/README.md) | +| Essential_contacts_service.update_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/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-essentialcontacts/samples/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-essentialcontacts/samples/README.md b/packages/google-cloud-essentialcontacts/samples/README.md index 05cb78cb7be..d23a855f3e3 100644 --- a/packages/google-cloud-essentialcontacts/samples/README.md +++ b/packages/google-cloud-essentialcontacts/samples/README.md @@ -38,14 +38,14 @@ Before running the samples, make sure you've followed the steps outlined in ### Essential_contacts_service.compute_contacts -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.compute_contacts.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.compute_contacts.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-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.compute_contacts.js` +`node packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.compute_contacts.js` ----- @@ -55,14 +55,14 @@ __Usage:__ ### Essential_contacts_service.create_contact -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.create_contact.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.create_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.create_contact.js` +`node packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.create_contact.js` ----- @@ -72,14 +72,14 @@ __Usage:__ ### Essential_contacts_service.delete_contact -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.delete_contact.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.delete_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.delete_contact.js` +`node packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.delete_contact.js` ----- @@ -89,14 +89,14 @@ __Usage:__ ### Essential_contacts_service.get_contact -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.get_contact.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.get_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.get_contact.js` +`node packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.get_contact.js` ----- @@ -106,14 +106,14 @@ __Usage:__ ### Essential_contacts_service.list_contacts -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.list_contacts.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.list_contacts.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-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.list_contacts.js` +`node packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.list_contacts.js` ----- @@ -123,14 +123,14 @@ __Usage:__ ### Essential_contacts_service.send_test_message -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.send_test_message.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.send_test_message.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-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.send_test_message.js` +`node packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js` ----- @@ -140,14 +140,14 @@ __Usage:__ ### Essential_contacts_service.update_contact -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.update_contact.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.update_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/essential_contacts_service.update_contact.js` +`node packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js` ----- @@ -157,14 +157,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-essentialcontacts/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-essentialcontacts/samples/quickstart.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/quickstart.js` +`node packages/google-cloud-essentialcontacts/samples/quickstart.js` diff --git a/release-please-config.json b/release-please-config.json index 9b1e8441fd6..5880a2f598b 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 9e3739553f8be2ffebacc78d7dcaa613f0a08500 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Fri, 11 Nov 2022 18:09:57 -0800 Subject: [PATCH 68/69] samples: add test --- .../samples/test/quickstart.test.js | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 packages/google-cloud-essentialcontacts/samples/test/quickstart.test.js diff --git a/packages/google-cloud-essentialcontacts/samples/test/quickstart.test.js b/packages/google-cloud-essentialcontacts/samples/test/quickstart.test.js new file mode 100644 index 00000000000..42bd65f3be5 --- /dev/null +++ b/packages/google-cloud-essentialcontacts/samples/test/quickstart.test.js @@ -0,0 +1,45 @@ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +// eslint-disable-next-line no-unused-vars, node/no-missing-require +const {assert} = require('chai'); +const { + EssentialContactsServiceClient, +} = require('@google-cloud/essential-contacts'); +const client = new EssentialContactsServiceClient(); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync(`node ./quickstart.js ${projectId}`, {cwd}); + assert.match(stdout, /\[[\s\S]*\]/); + }); +}); From f5c2d09fd241b74dbd6d4f26a2509b43cda264c5 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 12 Nov 2022 02:31:56 +0000 Subject: [PATCH 69/69] =?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 --- .../google-cloud-essentialcontacts/README.md | 1 + .../samples/README.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/packages/google-cloud-essentialcontacts/README.md b/packages/google-cloud-essentialcontacts/README.md index 19db40d9517..fcdd23a9fa0 100644 --- a/packages/google-cloud-essentialcontacts/README.md +++ b/packages/google-cloud-essentialcontacts/README.md @@ -96,6 +96,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Essential_contacts_service.send_test_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.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-essentialcontacts/samples/generated/v1/essential_contacts_service.send_test_message.js,samples/README.md) | | Essential_contacts_service.update_contact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.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-essentialcontacts/samples/generated/v1/essential_contacts_service.update_contact.js,samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/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-essentialcontacts/samples/quickstart.js,samples/README.md) | +| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/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-essentialcontacts/samples/test/quickstart.test.js,samples/README.md) | diff --git a/packages/google-cloud-essentialcontacts/samples/README.md b/packages/google-cloud-essentialcontacts/samples/README.md index d23a855f3e3..1ac39139795 100644 --- a/packages/google-cloud-essentialcontacts/samples/README.md +++ b/packages/google-cloud-essentialcontacts/samples/README.md @@ -20,6 +20,7 @@ * [Essential_contacts_service.send_test_message](#essential_contacts_service.send_test_message) * [Essential_contacts_service.update_contact](#essential_contacts_service.update_contact) * [Quickstart](#quickstart) + * [Quickstart.test](#quickstart.test) ## Before you begin @@ -167,6 +168,23 @@ __Usage:__ `node packages/google-cloud-essentialcontacts/samples/quickstart.js` +----- + + + + +### Quickstart.test + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-essentialcontacts/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-essentialcontacts/samples/test/quickstart.test.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-essentialcontacts/samples/test/quickstart.test.js` + +