From b0c6212b99dee4c919a99c234bc2233a41f68e74 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Tue, 17 Mar 2020 19:14:44 -0700 Subject: [PATCH 001/147] chore: initial library generation --- .../CODE_OF_CONDUCT.md | 43 ++++ .../CONTRIBUTING.md | 65 ++++++ .../google-cloud-mediatranslation/LICENSE | 202 ++++++++++++++++++ .../google-cloud-mediatranslation/README.md | 101 +++++++++ .../google-cloud-mediatranslation/synth.py | 47 ++++ 5 files changed, 458 insertions(+) create mode 100644 packages/google-cloud-mediatranslation/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-mediatranslation/CONTRIBUTING.md create mode 100644 packages/google-cloud-mediatranslation/LICENSE create mode 100644 packages/google-cloud-mediatranslation/README.md create mode 100644 packages/google-cloud-mediatranslation/synth.py diff --git a/packages/google-cloud-mediatranslation/CODE_OF_CONDUCT.md b/packages/google-cloud-mediatranslation/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..46b2a08ea6d --- /dev/null +++ b/packages/google-cloud-mediatranslation/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/packages/google-cloud-mediatranslation/CONTRIBUTING.md b/packages/google-cloud-mediatranslation/CONTRIBUTING.md new file mode 100644 index 00000000000..f6c4cf010e3 --- /dev/null +++ b/packages/google-cloud-mediatranslation/CONTRIBUTING.md @@ -0,0 +1,65 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + gcloud auth application-default login + npm run samples-test + + # Run all system tests. + gcloud auth application-default login + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup diff --git a/packages/google-cloud-mediatranslation/LICENSE b/packages/google-cloud-mediatranslation/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-mediatranslation/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-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md new file mode 100644 index 00000000000..c6256aab835 --- /dev/null +++ b/packages/google-cloud-mediatranslation/README.md @@ -0,0 +1,101 @@ +[//]: # "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 + +# [Cloud Media Translation: Node.js Client](https://github.com/googleapis/nodejs-media-translation) + +[![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/media-translation.svg)](https://www.npmjs.org/package/@google-cloud/media-translation) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-media-translation/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-media-translation) + + + + +Mediatranslation client for Node.js + + +* [Cloud Media Translation Node.js Client API Reference][client-docs] +* [Cloud Media Translation Documentation][product-docs] +* [github.com/googleapis/nodejs-media-translation](https://github.com/googleapis/nodejs-media-translation) + +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 Cloud Media Translation 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/media-translation +``` + + + + + +The [Cloud Media Translation Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be in **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-media-translation/blob/master/CONTRIBUTING.md). + +Please note that this [README.md](README.md), the [samples/README.md](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-media-translation/blob/master/LICENSE) + +[client-docs]: https://googleapis.dev/nodejs/mediatranslation/latest +[product-docs]: https://cloud.google.com/mediatranslation/docs/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=mediatranslation.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-mediatranslation/synth.py b/packages/google-cloud-mediatranslation/synth.py new file mode 100644 index 00000000000..dd96b391775 --- /dev/null +++ b/packages/google-cloud-mediatranslation/synth.py @@ -0,0 +1,47 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import subprocess +import logging + +logging.basicConfig(level=logging.DEBUG) + +# run the gapic generator +gapic = gcp.GAPICMicrogenerator() +versions = ['v1beta1'] +name = 'mediatranslation' +for version in versions: + library = gapic.typescript_library( + name, + generator_args={ + "grpc-service-config": f"google/cloud/{name}/{version}/{name}_grpc_service_config.json", + 'package-name': '@google-cloud/media-translation', + }, + extra_proto_files=['google/cloud/common_resources.proto'], + proto_path=f'/google/cloud/{name}/{version}', + version=version) +s.copy(library, excludes=['README.md']) + +# Copy common templates +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library(source_location='build/src') +s.copy(templates, excludes=[]) + +# Node.js specific cleanup +subprocess.run(['npm', 'install']) +subprocess.run(['npm', 'run', 'fix']) + From ce0e4f97970bac1519af81b0d6a637e0cb632847 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 18 Mar 2020 21:32:08 -0700 Subject: [PATCH 002/147] feat!: initial library generation (#1) --- .../.eslintignore | 5 + .../.eslintrc.yml | 15 + .../google-cloud-mediatranslation/.gitignore | 14 + .../google-cloud-mediatranslation/.jsdoc.js | 55 + .../google-cloud-mediatranslation/.mocharc.js | 28 + .../.mocharc.json | 5 + packages/google-cloud-mediatranslation/.nycrc | 24 + .../.prettierignore | 3 + .../google-cloud-mediatranslation/.prettierrc | 8 + .../.repo-metadata.json | 13 + .../google-cloud-mediatranslation/README.md | 35 +- .../codecov.yaml | 4 + .../linkinator.config.json | 14 + .../package.json | 56 + .../google/cloud/common_resources.proto | 52 + .../v1beta1/media_translation.proto | 197 + .../protos/protos.d.ts | 4034 ++++++ .../protos/protos.js | 10716 ++++++++++++++++ .../protos/protos.json | 1187 ++ .../samples/README.md | 50 + .../samples/package.json | 23 + .../samples/quickstart.js | 38 + .../samples/test/quickstart.js | 36 + .../src/index.ts | 26 + .../src/v1beta1/index.ts | 19 + .../speech_translation_service_client.ts | 316 + ...ech_translation_service_client_config.json | 31 + ...speech_translation_service_proto_list.json | 3 + .../synth.metadata | 24 + .../google-cloud-mediatranslation/synth.py | 2 +- .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 25 + .../system-test/install.ts | 51 + ...apic-speech_translation_service-v1beta1.ts | 181 + .../tsconfig.json | 19 + .../google-cloud-mediatranslation/tslint.json | 3 + .../webpack.config.js | 64 + 37 files changed, 17399 insertions(+), 4 deletions(-) create mode 100644 packages/google-cloud-mediatranslation/.eslintignore create mode 100644 packages/google-cloud-mediatranslation/.eslintrc.yml create mode 100644 packages/google-cloud-mediatranslation/.gitignore create mode 100644 packages/google-cloud-mediatranslation/.jsdoc.js create mode 100644 packages/google-cloud-mediatranslation/.mocharc.js create mode 100644 packages/google-cloud-mediatranslation/.mocharc.json create mode 100644 packages/google-cloud-mediatranslation/.nycrc create mode 100644 packages/google-cloud-mediatranslation/.prettierignore create mode 100644 packages/google-cloud-mediatranslation/.prettierrc create mode 100644 packages/google-cloud-mediatranslation/.repo-metadata.json create mode 100644 packages/google-cloud-mediatranslation/codecov.yaml create mode 100644 packages/google-cloud-mediatranslation/linkinator.config.json create mode 100644 packages/google-cloud-mediatranslation/package.json create mode 100644 packages/google-cloud-mediatranslation/protos/google/cloud/common_resources.proto create mode 100644 packages/google-cloud-mediatranslation/protos/google/cloud/mediatranslation/v1beta1/media_translation.proto create mode 100644 packages/google-cloud-mediatranslation/protos/protos.d.ts create mode 100644 packages/google-cloud-mediatranslation/protos/protos.js create mode 100644 packages/google-cloud-mediatranslation/protos/protos.json create mode 100644 packages/google-cloud-mediatranslation/samples/README.md create mode 100644 packages/google-cloud-mediatranslation/samples/package.json create mode 100644 packages/google-cloud-mediatranslation/samples/quickstart.js create mode 100644 packages/google-cloud-mediatranslation/samples/test/quickstart.js create mode 100644 packages/google-cloud-mediatranslation/src/index.ts create mode 100644 packages/google-cloud-mediatranslation/src/v1beta1/index.ts create mode 100644 packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts create mode 100644 packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client_config.json create mode 100644 packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_proto_list.json create mode 100644 packages/google-cloud-mediatranslation/synth.metadata create mode 100644 packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-mediatranslation/system-test/install.ts create mode 100644 packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts create mode 100644 packages/google-cloud-mediatranslation/tsconfig.json create mode 100644 packages/google-cloud-mediatranslation/tslint.json create mode 100644 packages/google-cloud-mediatranslation/webpack.config.js diff --git a/packages/google-cloud-mediatranslation/.eslintignore b/packages/google-cloud-mediatranslation/.eslintignore new file mode 100644 index 00000000000..09b31fe735a --- /dev/null +++ b/packages/google-cloud-mediatranslation/.eslintignore @@ -0,0 +1,5 @@ +**/node_modules +src/**/doc/* +build/ +docs/ +protos/ diff --git a/packages/google-cloud-mediatranslation/.eslintrc.yml b/packages/google-cloud-mediatranslation/.eslintrc.yml new file mode 100644 index 00000000000..73eeec27612 --- /dev/null +++ b/packages/google-cloud-mediatranslation/.eslintrc.yml @@ -0,0 +1,15 @@ +--- +extends: + - 'eslint:recommended' + - 'plugin:node/recommended' + - prettier +plugins: + - node + - prettier +rules: + prettier/prettier: error + block-scoped-var: error + eqeqeq: error + no-warning-comments: warn + no-var: error + prefer-const: error diff --git a/packages/google-cloud-mediatranslation/.gitignore b/packages/google-cloud-mediatranslation/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-mediatranslation/.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-mediatranslation/.jsdoc.js b/packages/google-cloud-mediatranslation/.jsdoc.js new file mode 100644 index 00000000000..f0b72506ae9 --- /dev/null +++ b/packages/google-cloud-mediatranslation/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2019 Google, LLC.', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/media-translation', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-mediatranslation/.mocharc.js b/packages/google-cloud-mediatranslation/.mocharc.js new file mode 100644 index 00000000000..ff7b34fa5d1 --- /dev/null +++ b/packages/google-cloud-mediatranslation/.mocharc.js @@ -0,0 +1,28 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-mediatranslation/.mocharc.json b/packages/google-cloud-mediatranslation/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-mediatranslation/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-mediatranslation/.nycrc b/packages/google-cloud-mediatranslation/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-mediatranslation/.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-mediatranslation/.prettierignore b/packages/google-cloud-mediatranslation/.prettierignore new file mode 100644 index 00000000000..f6fac98b0a8 --- /dev/null +++ b/packages/google-cloud-mediatranslation/.prettierignore @@ -0,0 +1,3 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* diff --git a/packages/google-cloud-mediatranslation/.prettierrc b/packages/google-cloud-mediatranslation/.prettierrc new file mode 100644 index 00000000000..df6eac07446 --- /dev/null +++ b/packages/google-cloud-mediatranslation/.prettierrc @@ -0,0 +1,8 @@ +--- +bracketSpacing: false +printWidth: 80 +semi: true +singleQuote: true +tabWidth: 2 +trailingComma: es5 +useTabs: false diff --git a/packages/google-cloud-mediatranslation/.repo-metadata.json b/packages/google-cloud-mediatranslation/.repo-metadata.json new file mode 100644 index 00000000000..26498f3761d --- /dev/null +++ b/packages/google-cloud-mediatranslation/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "name": "mediatranslation", + "name_pretty": "Cloud Media Translation", + "product_documentation": "https://cloud.google.com/mediatranslation/docs/", + "client_documentation": "https://googleapis.dev/nodejs/mediatranslation/latest", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559749", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/nodejs-media-translation", + "distribution_name": "@google-cloud/media-translation", + "api_id": "mediatranslation.googleapis.com", + "requires_billing": true +} diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index c6256aab835..dcd7093a245 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -29,8 +29,8 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. * [Quickstart](#quickstart) * [Before you begin](#before-you-begin) * [Installing the client library](#installing-the-client-library) - - + * [Using the client library](#using-the-client-library) +* [Samples](#samples) * [Versioning](#versioning) * [Contributing](#contributing) * [License](#license) @@ -52,6 +52,35 @@ npm install @google-cloud/media-translation ``` +### Using the client library + +```javascript + // Imports the Google Cloud client library + const { + SpeechTranslationServiceClient, + } = require('@google-cloud/media-translation'); + + // Creates a client + const translate = new SpeechTranslationServiceClient(); + + // parent = 'projects/my-project', // Project to list dashboards for. + + // TODO: add an actual sample. + console.info(translate); + + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-media-translation/tree/master/samples) directory. The samples' `README.md` +has instructions for running the samples. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-media-translation/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-media-translation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | @@ -80,7 +109,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-media-translation/blob/master/CONTRIBUTING.md). -Please note that this [README.md](README.md), the [samples/README.md](samples/README.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 diff --git a/packages/google-cloud-mediatranslation/codecov.yaml b/packages/google-cloud-mediatranslation/codecov.yaml new file mode 100644 index 00000000000..5724ea9478d --- /dev/null +++ b/packages/google-cloud-mediatranslation/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/packages/google-cloud-mediatranslation/linkinator.config.json b/packages/google-cloud-mediatranslation/linkinator.config.json new file mode 100644 index 00000000000..3d251c6f25f --- /dev/null +++ b/packages/google-cloud-mediatranslation/linkinator.config.json @@ -0,0 +1,14 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://googleapis.dev/nodejs/mediatranslation/latest", + "https://github.com/googleapis/nodejs-media-translation/tree/master/samples", + "https://github.com/googleapis/nodejs-media-translation/blob/master/samples/quickstart.js", + "https://cloud.google.com/mediatranslation/docs/" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json new file mode 100644 index 00000000000..dcbd296eaf9 --- /dev/null +++ b/packages/google-cloud-mediatranslation/package.json @@ -0,0 +1,56 @@ +{ + "name": "@google-cloud/media-translation", + "version": "0.1.0", + "description": "Mediatranslation client for Node.js", + "repository": "googleapis/nodejs-media-translation", + "license": "Apache-2.0", + "author": "Google LLC", + "files": [ + "build/src", + "build/protos" + ], + "main": "build/src/index.js", + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "docs-test": "linkinator docs", + "predocs-test": "npm run docs", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "fix": "gts fix && eslint samples --fix", + "lint": "gts check && eslint samples", + "prelint": "cd samples; npm link ../; npm i", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" + }, + "dependencies": { + "google-gax": "^1.14.2" + }, + "devDependencies": { + "@types/mocha": "^5.2.7", + "@types/node": "^12.12.29", + "c8": "^7.1.0", + "eslint": "^6.8.0", + "eslint-config-prettier": "^6.10.0", + "eslint-plugin-node": "^11.0.0", + "eslint-plugin-prettier": "^3.1.2", + "gts": "^1.1.2", + "jsdoc": "^3.6.3", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.4", + "linkinator": "^2.0.3", + "mocha": "^6.2.2", + "null-loader": "^3.0.0", + "pack-n-play": "^1.0.0-2", + "prettier": "^1.19.1", + "ts-loader": "^6.2.1", + "typescript": "~3.7.5", + "webpack": "^4.42.0", + "webpack-cli": "^3.3.11" + }, + "engines": { + "node": ">=8.13.0" + } +} diff --git a/packages/google-cloud-mediatranslation/protos/google/cloud/common_resources.proto b/packages/google-cloud-mediatranslation/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-mediatranslation/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-mediatranslation/protos/google/cloud/mediatranslation/v1beta1/media_translation.proto b/packages/google-cloud-mediatranslation/protos/google/cloud/mediatranslation/v1beta1/media_translation.proto new file mode 100644 index 00000000000..88eed82ab05 --- /dev/null +++ b/packages/google-cloud-mediatranslation/protos/google/cloud/mediatranslation/v1beta1/media_translation.proto @@ -0,0 +1,197 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.mediatranslation.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/rpc/status.proto"; +import "google/api/client.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/mediatranslation/v1beta1;mediatranslation"; +option java_multiple_files = true; +option java_outer_classname = "MediaTranslationProto"; +option java_package = "com.google.cloud.mediatranslation.v1beta1"; +option csharp_namespace = "Google.Cloud.MediaTranslation.V1Beta1"; +option ruby_package = "Google::Cloud::MediaTranslation::V1beta1"; +option php_namespace = "Google\\Cloud\\MediaTranslation\\V1beta1"; + +// Provides translation from/to media types. +service SpeechTranslationService { + option (google.api.default_host) = "mediatranslation.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Performs bidirectional streaming speech translation: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + rpc StreamingTranslateSpeech(stream StreamingTranslateSpeechRequest) returns (stream StreamingTranslateSpeechResponse) { + } +} + +// Provides information to the speech translation that specifies how to process +// the request. +message TranslateSpeechConfig { + // Required. Encoding of audio data. + // Supported formats: + // + // - `linear16` + // + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // + // + string audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Source language code (BCP-47) of the input audio. + string source_language_code = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A list of up to 3 additional language codes (BCP-47), listing possible + // alternative languages of the supplied audio. If alternative source + // languages are listed, speech translation result will translate in the most + // likely language detected including the main source_language_code. The + // translated result will include the language code of the language detected + // in the audio. + repeated string alternative_source_language_codes = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Target language code (BCP-47) of the output. + string target_language_code = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Sample rate in Hertz of the audio data. Valid values are: + // 8000-48000. 16000 is optimal. For best results, set the sampling rate of + // the audio source to 16000 Hz. If that's not possible, use the native sample + // rate of the audio source (instead of re-sampling). This field can only be + // omitted for `FLAC` and `WAV` audio files. + int32 sample_rate_hertz = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. + string model = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Config used for streaming translation. +message StreamingTranslateSpeechConfig { + // Required. The common config for all the following audio contents. + TranslateSpeechConfig audio_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If `false` or omitted, the system performs + // continuous translation (continuing to wait for and process audio even if + // the user pauses speaking) until the client closes the input stream (gRPC + // API) or until the maximum time limit has been reached. May return multiple + // `StreamingTranslateSpeechResult`s with the `is_final` flag set to `true`. + // + // If `true`, the speech translator will detect a single spoken utterance. + // When it detects that the user has paused or stopped speaking, it will + // return an `END_OF_SINGLE_UTTERANCE` event and cease translation. + // When the client receives 'END_OF_SINGLE_UTTERANCE' event, the client should + // stop sending the requests. However, clients should keep receiving remaining + // responses until the stream is terminated. To construct the complete + // sentence in a streaming way, one should override (if 'is_final' of previous + // response is false), or append (if 'is_final' of previous response is true). + bool single_utterance = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The top-level message sent by the client for the `StreamingTranslateSpeech` +// method. Multiple `StreamingTranslateSpeechRequest` messages are sent. The +// first message must contain a `streaming_config` message and must not contain +// `audio_content` data. All subsequent messages must contain `audio_content` +// data and must not contain a `streaming_config` message. +message StreamingTranslateSpeechRequest { + // The streaming request, which is either a streaming config or content. + oneof streaming_request { + // Provides information to the recognizer that specifies how to process the + // request. The first `StreamingTranslateSpeechRequest` message must contain + // a `streaming_config` message. + StreamingTranslateSpeechConfig streaming_config = 1; + + // The audio data to be translated. Sequential chunks of audio data are sent + // in sequential `StreamingTranslateSpeechRequest` messages. The first + // `StreamingTranslateSpeechRequest` message must not contain + // `audio_content` data and all subsequent `StreamingTranslateSpeechRequest` + // messages must contain `audio_content` data. The audio bytes must be + // encoded as specified in `StreamingTranslateSpeechConfig`. Note: as with + // all bytes fields, protobuffers use a pure binary representation (not + // base64). + bytes audio_content = 2; + } +} + +// A streaming speech translation result corresponding to a portion of the audio +// that is currently being processed. +message StreamingTranslateSpeechResult { + // Text translation result. + message TextTranslationResult { + // Output only. The translated sentence. + string translation = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If `false`, this `StreamingTranslateSpeechResult` represents + // an interim result that may change. If `true`, this is the final time the + // translation service will return this particular + // `StreamingTranslateSpeechResult`, the streaming translator will not + // return any further hypotheses for this portion of the transcript and + // corresponding audio. + bool is_final = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The source language code (BCP-47) detected in the audio. Speech + // translation result will translate in the most likely language detected + // including the alternative source languages and main source_language_code. + string detected_source_language_code = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Translation result. + // + // Use oneof field to reserve for future tts result. + oneof result { + // Text translation result. + TextTranslationResult text_translation_result = 1; + } + + // Output only. The debug only recognition result in original language. This field is debug + // only and will be set to empty string if not available. + // This is implementation detail and will not be backward compatible. + // + // Still need to decide whether to expose this field by default. + string recognition_result = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A streaming speech translation response corresponding to a portion of +// the audio currently processed. +message StreamingTranslateSpeechResponse { + // Indicates the type of speech event. + enum SpeechEventType { + // No speech event specified. + SPEECH_EVENT_TYPE_UNSPECIFIED = 0; + + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). When the client receives 'END_OF_SINGLE_UTTERANCE' + // event, the client should stop sending the requests. However, clients + // should keep receiving remaining responses until the stream is terminated. + // To construct the complete sentence in a streaming way, one should + // override (if 'is_final' of previous response is false), or append (if + // 'is_final' of previous response is true). This event is only sent if + // `single_utterance` was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 1; + } + + // Output only. If set, returns a [google.rpc.Status][google.rpc.Status] message that + // specifies the error for the operation. + google.rpc.Status error = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The translation result that is currently being processed (is_final could be + // true or false). + StreamingTranslateSpeechResult result = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates the type of speech event. + SpeechEventType speech_event_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts new file mode 100644 index 00000000000..a3a1f742052 --- /dev/null +++ b/packages/google-cloud-mediatranslation/protos/protos.d.ts @@ -0,0 +1,4034 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as Long from "long"; +import * as $protobuf from "protobufjs"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace mediatranslation. */ + namespace mediatranslation { + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents a SpeechTranslationService */ + class SpeechTranslationService extends $protobuf.rpc.Service { + + /** + * Constructs a new SpeechTranslationService 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 SpeechTranslationService 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): SpeechTranslationService; + + /** + * Calls StreamingTranslateSpeech. + * @param request StreamingTranslateSpeechRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingTranslateSpeechResponse + */ + public streamingTranslateSpeech(request: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest, callback: google.cloud.mediatranslation.v1beta1.SpeechTranslationService.StreamingTranslateSpeechCallback): void; + + /** + * Calls StreamingTranslateSpeech. + * @param request StreamingTranslateSpeechRequest message or plain object + * @returns Promise + */ + public streamingTranslateSpeech(request: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest): Promise; + } + + namespace SpeechTranslationService { + + /** + * Callback as used by {@link google.cloud.mediatranslation.v1beta1.SpeechTranslationService#streamingTranslateSpeech}. + * @param error Error, if any + * @param [response] StreamingTranslateSpeechResponse + */ + type StreamingTranslateSpeechCallback = (error: (Error|null), response?: google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse) => void; + } + + /** Properties of a TranslateSpeechConfig. */ + interface ITranslateSpeechConfig { + + /** TranslateSpeechConfig audioEncoding */ + audioEncoding?: (string|null); + + /** TranslateSpeechConfig sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslateSpeechConfig alternativeSourceLanguageCodes */ + alternativeSourceLanguageCodes?: (string[]|null); + + /** TranslateSpeechConfig targetLanguageCode */ + targetLanguageCode?: (string|null); + + /** TranslateSpeechConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** TranslateSpeechConfig model */ + model?: (string|null); + } + + /** Represents a TranslateSpeechConfig. */ + class TranslateSpeechConfig implements ITranslateSpeechConfig { + + /** + * Constructs a new TranslateSpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig); + + /** TranslateSpeechConfig audioEncoding. */ + public audioEncoding: string; + + /** TranslateSpeechConfig sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslateSpeechConfig alternativeSourceLanguageCodes. */ + public alternativeSourceLanguageCodes: string[]; + + /** TranslateSpeechConfig targetLanguageCode. */ + public targetLanguageCode: string; + + /** TranslateSpeechConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** TranslateSpeechConfig model. */ + public model: string; + + /** + * Creates a new TranslateSpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslateSpeechConfig instance + */ + public static create(properties?: google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig): google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig; + + /** + * Encodes the specified TranslateSpeechConfig message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.verify|verify} messages. + * @param message TranslateSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslateSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.verify|verify} messages. + * @param message TranslateSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslateSpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslateSpeechConfig + * @throws {Error} If the payload is not 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.mediatranslation.v1beta1.TranslateSpeechConfig; + + /** + * Decodes a TranslateSpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslateSpeechConfig + * @throws {Error} If the payload 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.mediatranslation.v1beta1.TranslateSpeechConfig; + + /** + * Verifies a TranslateSpeechConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslateSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslateSpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig; + + /** + * Creates a plain object from a TranslateSpeechConfig message. Also converts values to other types if specified. + * @param message TranslateSpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslateSpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StreamingTranslateSpeechConfig. */ + interface IStreamingTranslateSpeechConfig { + + /** StreamingTranslateSpeechConfig audioConfig */ + audioConfig?: (google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig|null); + + /** StreamingTranslateSpeechConfig singleUtterance */ + singleUtterance?: (boolean|null); + } + + /** Represents a StreamingTranslateSpeechConfig. */ + class StreamingTranslateSpeechConfig implements IStreamingTranslateSpeechConfig { + + /** + * Constructs a new StreamingTranslateSpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig); + + /** StreamingTranslateSpeechConfig audioConfig. */ + public audioConfig?: (google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig|null); + + /** StreamingTranslateSpeechConfig singleUtterance. */ + public singleUtterance: boolean; + + /** + * Creates a new StreamingTranslateSpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingTranslateSpeechConfig instance + */ + public static create(properties?: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig): google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig; + + /** + * Encodes the specified StreamingTranslateSpeechConfig message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.verify|verify} messages. + * @param message StreamingTranslateSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingTranslateSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.verify|verify} messages. + * @param message StreamingTranslateSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingTranslateSpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingTranslateSpeechConfig + * @throws {Error} If the payload is not 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.mediatranslation.v1beta1.StreamingTranslateSpeechConfig; + + /** + * Decodes a StreamingTranslateSpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingTranslateSpeechConfig + * @throws {Error} If the payload 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.mediatranslation.v1beta1.StreamingTranslateSpeechConfig; + + /** + * Verifies a StreamingTranslateSpeechConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingTranslateSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingTranslateSpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig; + + /** + * Creates a plain object from a StreamingTranslateSpeechConfig message. Also converts values to other types if specified. + * @param message StreamingTranslateSpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingTranslateSpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StreamingTranslateSpeechRequest. */ + interface IStreamingTranslateSpeechRequest { + + /** StreamingTranslateSpeechRequest streamingConfig */ + streamingConfig?: (google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig|null); + + /** StreamingTranslateSpeechRequest audioContent */ + audioContent?: (Uint8Array|string|null); + } + + /** Represents a StreamingTranslateSpeechRequest. */ + class StreamingTranslateSpeechRequest implements IStreamingTranslateSpeechRequest { + + /** + * Constructs a new StreamingTranslateSpeechRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest); + + /** StreamingTranslateSpeechRequest streamingConfig. */ + public streamingConfig?: (google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig|null); + + /** StreamingTranslateSpeechRequest audioContent. */ + public audioContent: (Uint8Array|string); + + /** StreamingTranslateSpeechRequest streamingRequest. */ + public streamingRequest?: ("streamingConfig"|"audioContent"); + + /** + * Creates a new StreamingTranslateSpeechRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingTranslateSpeechRequest instance + */ + public static create(properties?: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest): google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest; + + /** + * Encodes the specified StreamingTranslateSpeechRequest message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest.verify|verify} messages. + * @param message StreamingTranslateSpeechRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingTranslateSpeechRequest message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest.verify|verify} messages. + * @param message StreamingTranslateSpeechRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingTranslateSpeechRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingTranslateSpeechRequest + * @throws {Error} If the payload is not 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.mediatranslation.v1beta1.StreamingTranslateSpeechRequest; + + /** + * Decodes a StreamingTranslateSpeechRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingTranslateSpeechRequest + * @throws {Error} If the payload 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.mediatranslation.v1beta1.StreamingTranslateSpeechRequest; + + /** + * Verifies a StreamingTranslateSpeechRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingTranslateSpeechRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingTranslateSpeechRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest; + + /** + * Creates a plain object from a StreamingTranslateSpeechRequest message. Also converts values to other types if specified. + * @param message StreamingTranslateSpeechRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingTranslateSpeechRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StreamingTranslateSpeechResult. */ + interface IStreamingTranslateSpeechResult { + + /** StreamingTranslateSpeechResult textTranslationResult */ + textTranslationResult?: (google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult|null); + + /** StreamingTranslateSpeechResult recognitionResult */ + recognitionResult?: (string|null); + } + + /** Represents a StreamingTranslateSpeechResult. */ + class StreamingTranslateSpeechResult implements IStreamingTranslateSpeechResult { + + /** + * Constructs a new StreamingTranslateSpeechResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult); + + /** StreamingTranslateSpeechResult textTranslationResult. */ + public textTranslationResult?: (google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult|null); + + /** StreamingTranslateSpeechResult recognitionResult. */ + public recognitionResult: string; + + /** StreamingTranslateSpeechResult result. */ + public result?: "textTranslationResult"; + + /** + * Creates a new StreamingTranslateSpeechResult instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingTranslateSpeechResult instance + */ + public static create(properties?: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult): google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult; + + /** + * Encodes the specified StreamingTranslateSpeechResult message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.verify|verify} messages. + * @param message StreamingTranslateSpeechResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingTranslateSpeechResult message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.verify|verify} messages. + * @param message StreamingTranslateSpeechResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingTranslateSpeechResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingTranslateSpeechResult + * @throws {Error} If the payload is not 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.mediatranslation.v1beta1.StreamingTranslateSpeechResult; + + /** + * Decodes a StreamingTranslateSpeechResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingTranslateSpeechResult + * @throws {Error} If the payload 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.mediatranslation.v1beta1.StreamingTranslateSpeechResult; + + /** + * Verifies a StreamingTranslateSpeechResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingTranslateSpeechResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingTranslateSpeechResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult; + + /** + * Creates a plain object from a StreamingTranslateSpeechResult message. Also converts values to other types if specified. + * @param message StreamingTranslateSpeechResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingTranslateSpeechResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace StreamingTranslateSpeechResult { + + /** Properties of a TextTranslationResult. */ + interface ITextTranslationResult { + + /** TextTranslationResult translation */ + translation?: (string|null); + + /** TextTranslationResult isFinal */ + isFinal?: (boolean|null); + + /** TextTranslationResult detectedSourceLanguageCode */ + detectedSourceLanguageCode?: (string|null); + } + + /** Represents a TextTranslationResult. */ + class TextTranslationResult implements ITextTranslationResult { + + /** + * Constructs a new TextTranslationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult); + + /** TextTranslationResult translation. */ + public translation: string; + + /** TextTranslationResult isFinal. */ + public isFinal: boolean; + + /** TextTranslationResult detectedSourceLanguageCode. */ + public detectedSourceLanguageCode: string; + + /** + * Creates a new TextTranslationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns TextTranslationResult instance + */ + public static create(properties?: google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult): google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult; + + /** + * Encodes the specified TextTranslationResult message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.verify|verify} messages. + * @param message TextTranslationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextTranslationResult message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.verify|verify} messages. + * @param message TextTranslationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextTranslationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextTranslationResult + * @throws {Error} If the payload is not 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.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult; + + /** + * Decodes a TextTranslationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextTranslationResult + * @throws {Error} If the payload 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.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult; + + /** + * Verifies a TextTranslationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextTranslationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextTranslationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult; + + /** + * Creates a plain object from a TextTranslationResult message. Also converts values to other types if specified. + * @param message TextTranslationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextTranslationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a StreamingTranslateSpeechResponse. */ + interface IStreamingTranslateSpeechResponse { + + /** StreamingTranslateSpeechResponse error */ + error?: (google.rpc.IStatus|null); + + /** StreamingTranslateSpeechResponse result */ + result?: (google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult|null); + + /** StreamingTranslateSpeechResponse speechEventType */ + speechEventType?: (google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType|keyof typeof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType|null); + } + + /** Represents a StreamingTranslateSpeechResponse. */ + class StreamingTranslateSpeechResponse implements IStreamingTranslateSpeechResponse { + + /** + * Constructs a new StreamingTranslateSpeechResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResponse); + + /** StreamingTranslateSpeechResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** StreamingTranslateSpeechResponse result. */ + public result?: (google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult|null); + + /** StreamingTranslateSpeechResponse speechEventType. */ + public speechEventType: (google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType|keyof typeof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType); + + /** + * Creates a new StreamingTranslateSpeechResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingTranslateSpeechResponse instance + */ + public static create(properties?: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResponse): google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse; + + /** + * Encodes the specified StreamingTranslateSpeechResponse message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.verify|verify} messages. + * @param message StreamingTranslateSpeechResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingTranslateSpeechResponse message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.verify|verify} messages. + * @param message StreamingTranslateSpeechResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingTranslateSpeechResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingTranslateSpeechResponse + * @throws {Error} If the payload is not 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.mediatranslation.v1beta1.StreamingTranslateSpeechResponse; + + /** + * Decodes a StreamingTranslateSpeechResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingTranslateSpeechResponse + * @throws {Error} If the payload 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.mediatranslation.v1beta1.StreamingTranslateSpeechResponse; + + /** + * Verifies a StreamingTranslateSpeechResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingTranslateSpeechResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingTranslateSpeechResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse; + + /** + * Creates a plain object from a StreamingTranslateSpeechResponse message. Also converts values to other types if specified. + * @param message StreamingTranslateSpeechResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingTranslateSpeechResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace StreamingTranslateSpeechResponse { + + /** SpeechEventType enum. */ + enum SpeechEventType { + SPEECH_EVENT_TYPE_UNSPECIFIED = 0, + END_OF_SINGLE_UTTERANCE = 1 + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** 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); + } + + /** 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); + } + + /** 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.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js new file mode 100644 index 00000000000..33e7691527c --- /dev/null +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -0,0 +1,10716 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("protobufjs/minimal")); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.mediatranslation = (function() { + + /** + * Namespace mediatranslation. + * @memberof google.cloud + * @namespace + */ + var mediatranslation = {}; + + mediatranslation.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.mediatranslation + * @namespace + */ + var v1beta1 = {}; + + v1beta1.SpeechTranslationService = (function() { + + /** + * Constructs a new SpeechTranslationService service. + * @memberof google.cloud.mediatranslation.v1beta1 + * @classdesc Represents a SpeechTranslationService + * @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 SpeechTranslationService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SpeechTranslationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SpeechTranslationService; + + /** + * Creates new SpeechTranslationService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.mediatranslation.v1beta1.SpeechTranslationService + * @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 {SpeechTranslationService} RPC service. Useful where requests and/or responses are streamed. + */ + SpeechTranslationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.mediatranslation.v1beta1.SpeechTranslationService#streamingTranslateSpeech}. + * @memberof google.cloud.mediatranslation.v1beta1.SpeechTranslationService + * @typedef StreamingTranslateSpeechCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} [response] StreamingTranslateSpeechResponse + */ + + /** + * Calls StreamingTranslateSpeech. + * @function streamingTranslateSpeech + * @memberof google.cloud.mediatranslation.v1beta1.SpeechTranslationService + * @instance + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest} request StreamingTranslateSpeechRequest message or plain object + * @param {google.cloud.mediatranslation.v1beta1.SpeechTranslationService.StreamingTranslateSpeechCallback} callback Node-style callback called with the error, if any, and StreamingTranslateSpeechResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpeechTranslationService.prototype.streamingTranslateSpeech = function streamingTranslateSpeech(request, callback) { + return this.rpcCall(streamingTranslateSpeech, $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest, $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse, request, callback); + }, "name", { value: "StreamingTranslateSpeech" }); + + /** + * Calls StreamingTranslateSpeech. + * @function streamingTranslateSpeech + * @memberof google.cloud.mediatranslation.v1beta1.SpeechTranslationService + * @instance + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest} request StreamingTranslateSpeechRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SpeechTranslationService; + })(); + + v1beta1.TranslateSpeechConfig = (function() { + + /** + * Properties of a TranslateSpeechConfig. + * @memberof google.cloud.mediatranslation.v1beta1 + * @interface ITranslateSpeechConfig + * @property {string|null} [audioEncoding] TranslateSpeechConfig audioEncoding + * @property {string|null} [sourceLanguageCode] TranslateSpeechConfig sourceLanguageCode + * @property {Array.|null} [alternativeSourceLanguageCodes] TranslateSpeechConfig alternativeSourceLanguageCodes + * @property {string|null} [targetLanguageCode] TranslateSpeechConfig targetLanguageCode + * @property {number|null} [sampleRateHertz] TranslateSpeechConfig sampleRateHertz + * @property {string|null} [model] TranslateSpeechConfig model + */ + + /** + * Constructs a new TranslateSpeechConfig. + * @memberof google.cloud.mediatranslation.v1beta1 + * @classdesc Represents a TranslateSpeechConfig. + * @implements ITranslateSpeechConfig + * @constructor + * @param {google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig=} [properties] Properties to set + */ + function TranslateSpeechConfig(properties) { + this.alternativeSourceLanguageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslateSpeechConfig audioEncoding. + * @member {string} audioEncoding + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @instance + */ + TranslateSpeechConfig.prototype.audioEncoding = ""; + + /** + * TranslateSpeechConfig sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @instance + */ + TranslateSpeechConfig.prototype.sourceLanguageCode = ""; + + /** + * TranslateSpeechConfig alternativeSourceLanguageCodes. + * @member {Array.} alternativeSourceLanguageCodes + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @instance + */ + TranslateSpeechConfig.prototype.alternativeSourceLanguageCodes = $util.emptyArray; + + /** + * TranslateSpeechConfig targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @instance + */ + TranslateSpeechConfig.prototype.targetLanguageCode = ""; + + /** + * TranslateSpeechConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @instance + */ + TranslateSpeechConfig.prototype.sampleRateHertz = 0; + + /** + * TranslateSpeechConfig model. + * @member {string} model + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @instance + */ + TranslateSpeechConfig.prototype.model = ""; + + /** + * Creates a new TranslateSpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @static + * @param {google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig=} [properties] Properties to set + * @returns {google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig} TranslateSpeechConfig instance + */ + TranslateSpeechConfig.create = function create(properties) { + return new TranslateSpeechConfig(properties); + }; + + /** + * Encodes the specified TranslateSpeechConfig message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @static + * @param {google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig} message TranslateSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateSpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.audioEncoding); + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCode); + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.sampleRateHertz); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.model); + if (message.alternativeSourceLanguageCodes != null && message.alternativeSourceLanguageCodes.length) + for (var i = 0; i < message.alternativeSourceLanguageCodes.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.alternativeSourceLanguageCodes[i]); + return writer; + }; + + /** + * Encodes the specified TranslateSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @static + * @param {google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig} message TranslateSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslateSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslateSpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig} TranslateSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateSpeechConfig.decode = function 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.mediatranslation.v1beta1.TranslateSpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.audioEncoding = reader.string(); + break; + case 2: + message.sourceLanguageCode = reader.string(); + break; + case 6: + if (!(message.alternativeSourceLanguageCodes && message.alternativeSourceLanguageCodes.length)) + message.alternativeSourceLanguageCodes = []; + message.alternativeSourceLanguageCodes.push(reader.string()); + break; + case 3: + message.targetLanguageCode = reader.string(); + break; + case 4: + message.sampleRateHertz = reader.int32(); + break; + case 5: + message.model = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslateSpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig} TranslateSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslateSpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslateSpeechConfig message. + * @function verify + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslateSpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + if (!$util.isString(message.audioEncoding)) + return "audioEncoding: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.alternativeSourceLanguageCodes != null && message.hasOwnProperty("alternativeSourceLanguageCodes")) { + if (!Array.isArray(message.alternativeSourceLanguageCodes)) + return "alternativeSourceLanguageCodes: array expected"; + for (var i = 0; i < message.alternativeSourceLanguageCodes.length; ++i) + if (!$util.isString(message.alternativeSourceLanguageCodes[i])) + return "alternativeSourceLanguageCodes: string[] expected"; + } + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a TranslateSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig} TranslateSpeechConfig + */ + TranslateSpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig) + return object; + var message = new $root.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig(); + if (object.audioEncoding != null) + message.audioEncoding = String(object.audioEncoding); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.alternativeSourceLanguageCodes) { + if (!Array.isArray(object.alternativeSourceLanguageCodes)) + throw TypeError(".google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.alternativeSourceLanguageCodes: array expected"); + message.alternativeSourceLanguageCodes = []; + for (var i = 0; i < object.alternativeSourceLanguageCodes.length; ++i) + message.alternativeSourceLanguageCodes[i] = String(object.alternativeSourceLanguageCodes[i]); + } + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a TranslateSpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @static + * @param {google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig} message TranslateSpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslateSpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternativeSourceLanguageCodes = []; + if (options.defaults) { + object.audioEncoding = ""; + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + object.sampleRateHertz = 0; + object.model = ""; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = message.audioEncoding; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.alternativeSourceLanguageCodes && message.alternativeSourceLanguageCodes.length) { + object.alternativeSourceLanguageCodes = []; + for (var j = 0; j < message.alternativeSourceLanguageCodes.length; ++j) + object.alternativeSourceLanguageCodes[j] = message.alternativeSourceLanguageCodes[j]; + } + return object; + }; + + /** + * Converts this TranslateSpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @instance + * @returns {Object.} JSON object + */ + TranslateSpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TranslateSpeechConfig; + })(); + + v1beta1.StreamingTranslateSpeechConfig = (function() { + + /** + * Properties of a StreamingTranslateSpeechConfig. + * @memberof google.cloud.mediatranslation.v1beta1 + * @interface IStreamingTranslateSpeechConfig + * @property {google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig|null} [audioConfig] StreamingTranslateSpeechConfig audioConfig + * @property {boolean|null} [singleUtterance] StreamingTranslateSpeechConfig singleUtterance + */ + + /** + * Constructs a new StreamingTranslateSpeechConfig. + * @memberof google.cloud.mediatranslation.v1beta1 + * @classdesc Represents a StreamingTranslateSpeechConfig. + * @implements IStreamingTranslateSpeechConfig + * @constructor + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig=} [properties] Properties to set + */ + function StreamingTranslateSpeechConfig(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]]; + } + + /** + * StreamingTranslateSpeechConfig audioConfig. + * @member {google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig|null|undefined} audioConfig + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @instance + */ + StreamingTranslateSpeechConfig.prototype.audioConfig = null; + + /** + * StreamingTranslateSpeechConfig singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @instance + */ + StreamingTranslateSpeechConfig.prototype.singleUtterance = false; + + /** + * Creates a new StreamingTranslateSpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig=} [properties] Properties to set + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig} StreamingTranslateSpeechConfig instance + */ + StreamingTranslateSpeechConfig.create = function create(properties) { + return new StreamingTranslateSpeechConfig(properties); + }; + + /** + * Encodes the specified StreamingTranslateSpeechConfig message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig} message StreamingTranslateSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingTranslateSpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) + $root.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.encode(message.audioConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.singleUtterance); + return writer; + }; + + /** + * Encodes the specified StreamingTranslateSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig} message StreamingTranslateSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingTranslateSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingTranslateSpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig} StreamingTranslateSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingTranslateSpeechConfig.decode = function 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.mediatranslation.v1beta1.StreamingTranslateSpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.audioConfig = $root.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.decode(reader, reader.uint32()); + break; + case 2: + message.singleUtterance = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingTranslateSpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig} StreamingTranslateSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingTranslateSpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingTranslateSpeechConfig message. + * @function verify + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingTranslateSpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { + var error = $root.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.verify(message.audioConfig); + if (error) + return "audioConfig." + error; + } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + return null; + }; + + /** + * Creates a StreamingTranslateSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig} StreamingTranslateSpeechConfig + */ + StreamingTranslateSpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig) + return object; + var message = new $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig(); + if (object.audioConfig != null) { + if (typeof object.audioConfig !== "object") + throw TypeError(".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.audioConfig: object expected"); + message.audioConfig = $root.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.fromObject(object.audioConfig); + } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + return message; + }; + + /** + * Creates a plain object from a StreamingTranslateSpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @static + * @param {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig} message StreamingTranslateSpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingTranslateSpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioConfig = null; + object.singleUtterance = false; + } + if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) + object.audioConfig = $root.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.toObject(message.audioConfig, options); + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + return object; + }; + + /** + * Converts this StreamingTranslateSpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingTranslateSpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamingTranslateSpeechConfig; + })(); + + v1beta1.StreamingTranslateSpeechRequest = (function() { + + /** + * Properties of a StreamingTranslateSpeechRequest. + * @memberof google.cloud.mediatranslation.v1beta1 + * @interface IStreamingTranslateSpeechRequest + * @property {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig|null} [streamingConfig] StreamingTranslateSpeechRequest streamingConfig + * @property {Uint8Array|null} [audioContent] StreamingTranslateSpeechRequest audioContent + */ + + /** + * Constructs a new StreamingTranslateSpeechRequest. + * @memberof google.cloud.mediatranslation.v1beta1 + * @classdesc Represents a StreamingTranslateSpeechRequest. + * @implements IStreamingTranslateSpeechRequest + * @constructor + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest=} [properties] Properties to set + */ + function StreamingTranslateSpeechRequest(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]]; + } + + /** + * StreamingTranslateSpeechRequest streamingConfig. + * @member {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig|null|undefined} streamingConfig + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @instance + */ + StreamingTranslateSpeechRequest.prototype.streamingConfig = null; + + /** + * StreamingTranslateSpeechRequest audioContent. + * @member {Uint8Array} audioContent + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @instance + */ + StreamingTranslateSpeechRequest.prototype.audioContent = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingTranslateSpeechRequest streamingRequest. + * @member {"streamingConfig"|"audioContent"|undefined} streamingRequest + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @instance + */ + Object.defineProperty(StreamingTranslateSpeechRequest.prototype, "streamingRequest", { + get: $util.oneOfGetter($oneOfFields = ["streamingConfig", "audioContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingTranslateSpeechRequest instance using the specified properties. + * @function create + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest=} [properties] Properties to set + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest} StreamingTranslateSpeechRequest instance + */ + StreamingTranslateSpeechRequest.create = function create(properties) { + return new StreamingTranslateSpeechRequest(properties); + }; + + /** + * Encodes the specified StreamingTranslateSpeechRequest message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest} message StreamingTranslateSpeechRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingTranslateSpeechRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) + $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.encode(message.streamingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audioContent != null && message.hasOwnProperty("audioContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent); + return writer; + }; + + /** + * Encodes the specified StreamingTranslateSpeechRequest message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest} message StreamingTranslateSpeechRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingTranslateSpeechRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingTranslateSpeechRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest} StreamingTranslateSpeechRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingTranslateSpeechRequest.decode = function 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.mediatranslation.v1beta1.StreamingTranslateSpeechRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamingConfig = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.decode(reader, reader.uint32()); + break; + case 2: + message.audioContent = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingTranslateSpeechRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest} StreamingTranslateSpeechRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingTranslateSpeechRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingTranslateSpeechRequest message. + * @function verify + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingTranslateSpeechRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + properties.streamingRequest = 1; + { + var error = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.verify(message.streamingConfig); + if (error) + return "streamingConfig." + error; + } + } + if (message.audioContent != null && message.hasOwnProperty("audioContent")) { + if (properties.streamingRequest === 1) + return "streamingRequest: multiple values"; + properties.streamingRequest = 1; + if (!(message.audioContent && typeof message.audioContent.length === "number" || $util.isString(message.audioContent))) + return "audioContent: buffer expected"; + } + return null; + }; + + /** + * Creates a StreamingTranslateSpeechRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest} StreamingTranslateSpeechRequest + */ + StreamingTranslateSpeechRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest) + return object; + var message = new $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest(); + if (object.streamingConfig != null) { + if (typeof object.streamingConfig !== "object") + throw TypeError(".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest.streamingConfig: object expected"); + message.streamingConfig = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.fromObject(object.streamingConfig); + } + if (object.audioContent != null) + if (typeof object.audioContent === "string") + $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0); + else if (object.audioContent.length) + message.audioContent = object.audioContent; + return message; + }; + + /** + * Creates a plain object from a StreamingTranslateSpeechRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @static + * @param {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest} message StreamingTranslateSpeechRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingTranslateSpeechRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) { + object.streamingConfig = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.toObject(message.streamingConfig, options); + if (options.oneofs) + object.streamingRequest = "streamingConfig"; + } + if (message.audioContent != null && message.hasOwnProperty("audioContent")) { + object.audioContent = options.bytes === String ? $util.base64.encode(message.audioContent, 0, message.audioContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.audioContent) : message.audioContent; + if (options.oneofs) + object.streamingRequest = "audioContent"; + } + return object; + }; + + /** + * Converts this StreamingTranslateSpeechRequest to JSON. + * @function toJSON + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingTranslateSpeechRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamingTranslateSpeechRequest; + })(); + + v1beta1.StreamingTranslateSpeechResult = (function() { + + /** + * Properties of a StreamingTranslateSpeechResult. + * @memberof google.cloud.mediatranslation.v1beta1 + * @interface IStreamingTranslateSpeechResult + * @property {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult|null} [textTranslationResult] StreamingTranslateSpeechResult textTranslationResult + * @property {string|null} [recognitionResult] StreamingTranslateSpeechResult recognitionResult + */ + + /** + * Constructs a new StreamingTranslateSpeechResult. + * @memberof google.cloud.mediatranslation.v1beta1 + * @classdesc Represents a StreamingTranslateSpeechResult. + * @implements IStreamingTranslateSpeechResult + * @constructor + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult=} [properties] Properties to set + */ + function StreamingTranslateSpeechResult(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]]; + } + + /** + * StreamingTranslateSpeechResult textTranslationResult. + * @member {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult|null|undefined} textTranslationResult + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @instance + */ + StreamingTranslateSpeechResult.prototype.textTranslationResult = null; + + /** + * StreamingTranslateSpeechResult recognitionResult. + * @member {string} recognitionResult + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @instance + */ + StreamingTranslateSpeechResult.prototype.recognitionResult = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingTranslateSpeechResult result. + * @member {"textTranslationResult"|undefined} result + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @instance + */ + Object.defineProperty(StreamingTranslateSpeechResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["textTranslationResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingTranslateSpeechResult instance using the specified properties. + * @function create + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult=} [properties] Properties to set + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult} StreamingTranslateSpeechResult instance + */ + StreamingTranslateSpeechResult.create = function create(properties) { + return new StreamingTranslateSpeechResult(properties); + }; + + /** + * Encodes the specified StreamingTranslateSpeechResult message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult} message StreamingTranslateSpeechResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingTranslateSpeechResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textTranslationResult != null && message.hasOwnProperty("textTranslationResult")) + $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.encode(message.textTranslationResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recognitionResult); + return writer; + }; + + /** + * Encodes the specified StreamingTranslateSpeechResult message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult} message StreamingTranslateSpeechResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingTranslateSpeechResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingTranslateSpeechResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult} StreamingTranslateSpeechResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingTranslateSpeechResult.decode = function 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.mediatranslation.v1beta1.StreamingTranslateSpeechResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.textTranslationResult = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.decode(reader, reader.uint32()); + break; + case 3: + message.recognitionResult = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingTranslateSpeechResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult} StreamingTranslateSpeechResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingTranslateSpeechResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingTranslateSpeechResult message. + * @function verify + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingTranslateSpeechResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textTranslationResult != null && message.hasOwnProperty("textTranslationResult")) { + properties.result = 1; + { + var error = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.verify(message.textTranslationResult); + if (error) + return "textTranslationResult." + error; + } + } + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) + if (!$util.isString(message.recognitionResult)) + return "recognitionResult: string expected"; + return null; + }; + + /** + * Creates a StreamingTranslateSpeechResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult} StreamingTranslateSpeechResult + */ + StreamingTranslateSpeechResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult) + return object; + var message = new $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult(); + if (object.textTranslationResult != null) { + if (typeof object.textTranslationResult !== "object") + throw TypeError(".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.textTranslationResult: object expected"); + message.textTranslationResult = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.fromObject(object.textTranslationResult); + } + if (object.recognitionResult != null) + message.recognitionResult = String(object.recognitionResult); + return message; + }; + + /** + * Creates a plain object from a StreamingTranslateSpeechResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @static + * @param {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult} message StreamingTranslateSpeechResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingTranslateSpeechResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.recognitionResult = ""; + if (message.textTranslationResult != null && message.hasOwnProperty("textTranslationResult")) { + object.textTranslationResult = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.toObject(message.textTranslationResult, options); + if (options.oneofs) + object.result = "textTranslationResult"; + } + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) + object.recognitionResult = message.recognitionResult; + return object; + }; + + /** + * Converts this StreamingTranslateSpeechResult to JSON. + * @function toJSON + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @instance + * @returns {Object.} JSON object + */ + StreamingTranslateSpeechResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + StreamingTranslateSpeechResult.TextTranslationResult = (function() { + + /** + * Properties of a TextTranslationResult. + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @interface ITextTranslationResult + * @property {string|null} [translation] TextTranslationResult translation + * @property {boolean|null} [isFinal] TextTranslationResult isFinal + * @property {string|null} [detectedSourceLanguageCode] TextTranslationResult detectedSourceLanguageCode + */ + + /** + * Constructs a new TextTranslationResult. + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @classdesc Represents a TextTranslationResult. + * @implements ITextTranslationResult + * @constructor + * @param {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult=} [properties] Properties to set + */ + function TextTranslationResult(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]]; + } + + /** + * TextTranslationResult translation. + * @member {string} translation + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @instance + */ + TextTranslationResult.prototype.translation = ""; + + /** + * TextTranslationResult isFinal. + * @member {boolean} isFinal + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @instance + */ + TextTranslationResult.prototype.isFinal = false; + + /** + * TextTranslationResult detectedSourceLanguageCode. + * @member {string} detectedSourceLanguageCode + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @instance + */ + TextTranslationResult.prototype.detectedSourceLanguageCode = ""; + + /** + * Creates a new TextTranslationResult instance using the specified properties. + * @function create + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @static + * @param {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult=} [properties] Properties to set + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult} TextTranslationResult instance + */ + TextTranslationResult.create = function create(properties) { + return new TextTranslationResult(properties); + }; + + /** + * Encodes the specified TextTranslationResult message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @static + * @param {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult} message TextTranslationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextTranslationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.translation != null && message.hasOwnProperty("translation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.translation); + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isFinal); + if (message.detectedSourceLanguageCode != null && message.hasOwnProperty("detectedSourceLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.detectedSourceLanguageCode); + return writer; + }; + + /** + * Encodes the specified TextTranslationResult message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @static + * @param {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult} message TextTranslationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextTranslationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextTranslationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult} TextTranslationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextTranslationResult.decode = function 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.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.translation = reader.string(); + break; + case 2: + message.isFinal = reader.bool(); + break; + case 3: + message.detectedSourceLanguageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextTranslationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult} TextTranslationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextTranslationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextTranslationResult message. + * @function verify + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextTranslationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.translation != null && message.hasOwnProperty("translation")) + if (!$util.isString(message.translation)) + return "translation: string expected"; + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + if (typeof message.isFinal !== "boolean") + return "isFinal: boolean expected"; + if (message.detectedSourceLanguageCode != null && message.hasOwnProperty("detectedSourceLanguageCode")) + if (!$util.isString(message.detectedSourceLanguageCode)) + return "detectedSourceLanguageCode: string expected"; + return null; + }; + + /** + * Creates a TextTranslationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult} TextTranslationResult + */ + TextTranslationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult) + return object; + var message = new $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult(); + if (object.translation != null) + message.translation = String(object.translation); + if (object.isFinal != null) + message.isFinal = Boolean(object.isFinal); + if (object.detectedSourceLanguageCode != null) + message.detectedSourceLanguageCode = String(object.detectedSourceLanguageCode); + return message; + }; + + /** + * Creates a plain object from a TextTranslationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @static + * @param {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult} message TextTranslationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextTranslationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.translation = ""; + object.isFinal = false; + object.detectedSourceLanguageCode = ""; + } + if (message.translation != null && message.hasOwnProperty("translation")) + object.translation = message.translation; + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + object.isFinal = message.isFinal; + if (message.detectedSourceLanguageCode != null && message.hasOwnProperty("detectedSourceLanguageCode")) + object.detectedSourceLanguageCode = message.detectedSourceLanguageCode; + return object; + }; + + /** + * Converts this TextTranslationResult to JSON. + * @function toJSON + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @instance + * @returns {Object.} JSON object + */ + TextTranslationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextTranslationResult; + })(); + + return StreamingTranslateSpeechResult; + })(); + + v1beta1.StreamingTranslateSpeechResponse = (function() { + + /** + * Properties of a StreamingTranslateSpeechResponse. + * @memberof google.cloud.mediatranslation.v1beta1 + * @interface IStreamingTranslateSpeechResponse + * @property {google.rpc.IStatus|null} [error] StreamingTranslateSpeechResponse error + * @property {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult|null} [result] StreamingTranslateSpeechResponse result + * @property {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType|null} [speechEventType] StreamingTranslateSpeechResponse speechEventType + */ + + /** + * Constructs a new StreamingTranslateSpeechResponse. + * @memberof google.cloud.mediatranslation.v1beta1 + * @classdesc Represents a StreamingTranslateSpeechResponse. + * @implements IStreamingTranslateSpeechResponse + * @constructor + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResponse=} [properties] Properties to set + */ + function StreamingTranslateSpeechResponse(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]]; + } + + /** + * StreamingTranslateSpeechResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @instance + */ + StreamingTranslateSpeechResponse.prototype.error = null; + + /** + * StreamingTranslateSpeechResponse result. + * @member {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResult|null|undefined} result + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @instance + */ + StreamingTranslateSpeechResponse.prototype.result = null; + + /** + * StreamingTranslateSpeechResponse speechEventType. + * @member {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType} speechEventType + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @instance + */ + StreamingTranslateSpeechResponse.prototype.speechEventType = 0; + + /** + * Creates a new StreamingTranslateSpeechResponse instance using the specified properties. + * @function create + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResponse=} [properties] Properties to set + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} StreamingTranslateSpeechResponse instance + */ + StreamingTranslateSpeechResponse.create = function create(properties) { + return new StreamingTranslateSpeechResponse(properties); + }; + + /** + * Encodes the specified StreamingTranslateSpeechResponse message. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResponse} message StreamingTranslateSpeechResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingTranslateSpeechResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.result != null && message.hasOwnProperty("result")) + $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.encode(message.result, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.speechEventType); + return writer; + }; + + /** + * Encodes the specified StreamingTranslateSpeechResponse message, length delimited. Does not implicitly {@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @static + * @param {google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechResponse} message StreamingTranslateSpeechResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingTranslateSpeechResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingTranslateSpeechResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} StreamingTranslateSpeechResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingTranslateSpeechResponse.decode = function 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.mediatranslation.v1beta1.StreamingTranslateSpeechResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 2: + message.result = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.decode(reader, reader.uint32()); + break; + case 3: + message.speechEventType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingTranslateSpeechResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} StreamingTranslateSpeechResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingTranslateSpeechResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingTranslateSpeechResponse message. + * @function verify + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingTranslateSpeechResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.verify(message.result); + if (error) + return "result." + error; + } + if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + switch (message.speechEventType) { + default: + return "speechEventType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a StreamingTranslateSpeechResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} StreamingTranslateSpeechResponse + */ + StreamingTranslateSpeechResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse) + return object; + var message = new $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.result: object expected"); + message.result = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.fromObject(object.result); + } + switch (object.speechEventType) { + case "SPEECH_EVENT_TYPE_UNSPECIFIED": + case 0: + message.speechEventType = 0; + break; + case "END_OF_SINGLE_UTTERANCE": + case 1: + message.speechEventType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a StreamingTranslateSpeechResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @static + * @param {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} message StreamingTranslateSpeechResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingTranslateSpeechResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.error = null; + object.result = null; + object.speechEventType = options.enums === String ? "SPEECH_EVENT_TYPE_UNSPECIFIED" : 0; + } + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.toObject(message.result, options); + if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + object.speechEventType = options.enums === String ? $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType[message.speechEventType] : message.speechEventType; + return object; + }; + + /** + * Converts this StreamingTranslateSpeechResponse to JSON. + * @function toJSON + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingTranslateSpeechResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * SpeechEventType enum. + * @name google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType + * @enum {string} + * @property {number} SPEECH_EVENT_TYPE_UNSPECIFIED=0 SPEECH_EVENT_TYPE_UNSPECIFIED value + * @property {number} END_OF_SINGLE_UTTERANCE=1 END_OF_SINGLE_UTTERANCE value + */ + StreamingTranslateSpeechResponse.SpeechEventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPEECH_EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "END_OF_SINGLE_UTTERANCE"] = 1; + return values; + })(); + + return StreamingTranslateSpeechResponse; + })(); + + return v1beta1; + })(); + + return mediatranslation; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + return values; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && message.hasOwnProperty("package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && message.hasOwnProperty("syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && message.hasOwnProperty("extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && message.hasOwnProperty("typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {string} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {string} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && message.hasOwnProperty("inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && message.hasOwnProperty("outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = false; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = false; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {string} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + */ + + /** + * 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; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + 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; + 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; + } + } + 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]); + } + } + 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; + } + 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); + } + 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 + */ + + /** + * 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; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + 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; + } + } + 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; + } + 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]; + } + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {string} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {string} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {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.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + 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 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.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.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; + } + 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]; + } + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {string} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && message.hasOwnProperty("begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && message.hasOwnProperty("type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(); + + return protobuf; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && message.hasOwnProperty("code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && message.hasOwnProperty("message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-mediatranslation/protos/protos.json b/packages/google-cloud-mediatranslation/protos/protos.json new file mode 100644 index 00000000000..b73beda4e41 --- /dev/null +++ b/packages/google-cloud-mediatranslation/protos/protos.json @@ -0,0 +1,1187 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "mediatranslation": { + "nested": { + "v1beta1": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/cloud/mediatranslation/v1beta1;mediatranslation", + "java_multiple_files": true, + "java_outer_classname": "MediaTranslationProto", + "java_package": "com.google.cloud.mediatranslation.v1beta1", + "csharp_namespace": "Google.Cloud.MediaTranslation.V1Beta1", + "ruby_package": "Google::Cloud::MediaTranslation::V1beta1", + "php_namespace": "Google\\Cloud\\MediaTranslation\\V1beta1" + }, + "nested": { + "SpeechTranslationService": { + "options": { + "(google.api.default_host)": "mediatranslation.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "StreamingTranslateSpeech": { + "requestType": "StreamingTranslateSpeechRequest", + "requestStream": true, + "responseType": "StreamingTranslateSpeechResponse", + "responseStream": true + } + } + }, + "TranslateSpeechConfig": { + "fields": { + "audioEncoding": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceLanguageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "alternativeSourceLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "targetLanguageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "model": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StreamingTranslateSpeechConfig": { + "fields": { + "audioConfig": { + "type": "TranslateSpeechConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "singleUtterance": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StreamingTranslateSpeechRequest": { + "oneofs": { + "streamingRequest": { + "oneof": [ + "streamingConfig", + "audioContent" + ] + } + }, + "fields": { + "streamingConfig": { + "type": "StreamingTranslateSpeechConfig", + "id": 1 + }, + "audioContent": { + "type": "bytes", + "id": 2 + } + } + }, + "StreamingTranslateSpeechResult": { + "oneofs": { + "result": { + "oneof": [ + "textTranslationResult" + ] + } + }, + "fields": { + "textTranslationResult": { + "type": "TextTranslationResult", + "id": 1 + }, + "recognitionResult": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "TextTranslationResult": { + "fields": { + "translation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "isFinal": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "detectedSourceLanguageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "StreamingTranslateSpeechResponse": { + "fields": { + "error": { + "type": "google.rpc.Status", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "result": { + "type": "StreamingTranslateSpeechResult", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "speechEventType": { + "type": "SpeechEventType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "SpeechEventType": { + "values": { + "SPEECH_EVENT_TYPE_UNSPECIFIED": 0, + "END_OF_SINGLE_UTTERANCE": 1 + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI" + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5 + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": false + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-mediatranslation/samples/README.md b/packages/google-cloud-mediatranslation/samples/README.md new file mode 100644 index 00000000000..6457b141329 --- /dev/null +++ b/packages/google-cloud-mediatranslation/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 + +# [Cloud Media Translation: Node.js Samples](https://github.com/googleapis/nodejs-media-translation) + +[![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-media-translation#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-media-translation/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-media-translation&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-media-translation&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/mediatranslation/docs/ diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json new file mode 100644 index 00000000000..cd505f739b1 --- /dev/null +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "media-translation-samples", + "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/media-translation": "^0.1.0" + }, + "devDependencies": { + "c8": "^7.0.0", + "chai": "^4.2.0", + "mocha": "^7.0.0" + } +} diff --git a/packages/google-cloud-mediatranslation/samples/quickstart.js b/packages/google-cloud-mediatranslation/samples/quickstart.js new file mode 100644 index 00000000000..a10a56d3f15 --- /dev/null +++ b/packages/google-cloud-mediatranslation/samples/quickstart.js @@ -0,0 +1,38 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +'use strict'; + +async function quickstart() { + // parent = 'projects/my-project' // Project to list dashboards for. + // [START media_translation_quickstart] + // Imports the Google Cloud client library + const { + SpeechTranslationServiceClient, + } = require('@google-cloud/media-translation'); + + // Creates a client + const translate = new SpeechTranslationServiceClient(); + + // parent = 'projects/my-project', // Project to list dashboards for. + + // TODO: add an actual sample. + console.info(translate); + + // [END media_translation_quickstart] +} + +const args = process.argv.slice(2); +quickstart(...args).catch(console.error); diff --git a/packages/google-cloud-mediatranslation/samples/test/quickstart.js b/packages/google-cloud-mediatranslation/samples/test/quickstart.js new file mode 100644 index 00000000000..6fdf66492e8 --- /dev/null +++ b/packages/google-cloud-mediatranslation/samples/test/quickstart.js @@ -0,0 +1,36 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +'use strict'; + +const path = require('path'); +const {assert} = require('chai'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const PROJECT_ID = process.env.GCLOUD_PROJECT; + +describe('Sample Integration Tests', () => { + it('should run quickstart.js', async () => { + const stdout = execSync(`node ./quickstart.js projects/${PROJECT_ID}`, { + cwd, + }); + assert(stdout); + }); +}); diff --git a/packages/google-cloud-mediatranslation/src/index.ts b/packages/google-cloud-mediatranslation/src/index.ts new file mode 100644 index 00000000000..5429fa7b1a1 --- /dev/null +++ b/packages/google-cloud-mediatranslation/src/index.ts @@ -0,0 +1,26 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; +const SpeechTranslationServiceClient = v1beta1.SpeechTranslationServiceClient; +export {v1beta1, SpeechTranslationServiceClient}; +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default {v1beta1, SpeechTranslationServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/index.ts b/packages/google-cloud-mediatranslation/src/v1beta1/index.ts new file mode 100644 index 00000000000..9a17d1ffd7b --- /dev/null +++ b/packages/google-cloud-mediatranslation/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {SpeechTranslationServiceClient} from './speech_translation_service_client'; diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts new file mode 100644 index 00000000000..55232716eb8 --- /dev/null +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -0,0 +1,316 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './speech_translation_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Provides translation from/to media types. + * @class + * @memberof v1beta1 + */ +export class SpeechTranslationServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + 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; + speechTranslationServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SpeechTranslationServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this + .constructor as typeof SpeechTranslationServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof SpeechTranslationServiceClient).scopes; + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this._descriptors.stream = { + streamingTranslateSpeech: new this._gaxModule.StreamDescriptor( + gax.StreamType.BIDI_STREAMING + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.mediatranslation.v1beta1.SpeechTranslationService', + 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.speechTranslationServiceStub) { + return this.speechTranslationServiceStub; + } + + // Put together the "service stub" for + // google.cloud.mediatranslation.v1beta1.SpeechTranslationService. + this.speechTranslationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.mediatranslation.v1beta1.SpeechTranslationService' + ) + : // tslint:disable-next-line no-any + (this._protos as any).google.cloud.mediatranslation.v1beta1 + .SpeechTranslationService, + 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 speechTranslationServiceStubMethods = ['streamingTranslateSpeech']; + + for (const methodName of speechTranslationServiceStubMethods) { + const innerCallPromise = this.speechTranslationServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = this._gaxModule.createApiCall( + innerCallPromise, + this._defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + + return this.speechTranslationServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'mediatranslation.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'mediatranslation.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Performs bidirectional streaming speech translation: receive results while + * sending audio. This method is only available via the gRPC API (not REST). + * + * @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 is both readable and writable. It accepts objects + * representing [StreamingTranslateSpeechRequest]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest} for write() method, and + * will emit objects representing [StreamingTranslateSpeechResponse]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} on 'data' event asynchronously. + */ + streamingTranslateSpeech(options?: gax.CallOptions): gax.CancellableStream { + this.initialize(); + return this._innerApiCalls.streamingTranslateSpeech(options); + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.speechTranslationServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client_config.json b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client_config.json new file mode 100644 index 00000000000..75bcb1e3260 --- /dev/null +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.cloud.mediatranslation.v1beta1.SpeechTranslationService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "StreamingTranslateSpeech": { + "timeout_millis": 400000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_proto_list.json b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_proto_list.json new file mode 100644 index 00000000000..ede436a2170 --- /dev/null +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/mediatranslation/v1beta1/media_translation.proto" +] diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata new file mode 100644 index 00000000000..fa0f49ccb2a --- /dev/null +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -0,0 +1,24 @@ +{ + "updateTime": "2020-03-19T01:33:51.859054Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "275fbcce2c900278d487c33293a3c7e1fbcd3a34", + "internalRef": "301661567" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "mediatranslation", + "apiVersion": "v1beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-mediatranslation/synth.py b/packages/google-cloud-mediatranslation/synth.py index dd96b391775..a344de4b14b 100644 --- a/packages/google-cloud-mediatranslation/synth.py +++ b/packages/google-cloud-mediatranslation/synth.py @@ -34,7 +34,7 @@ extra_proto_files=['google/cloud/common_resources.proto'], proto_path=f'/google/cloud/{name}/{version}', version=version) -s.copy(library, excludes=['README.md']) +s.copy(library, excludes=['package.json', 'README.md']) # Copy common templates common_templates = gcp.CommonTemplates() diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..dd96f9de622 --- /dev/null +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const mediatranslation = require('@google-cloud/media-translation'); + +function main() { + const speechTranslationServiceClient = new mediatranslation.SpeechTranslationServiceClient(); +} + +main(); diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..b0daa946915 --- /dev/null +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {SpeechTranslationServiceClient} from '@google-cloud/media-translation'; + +function main() { + const speechTranslationServiceClient = new SpeechTranslationServiceClient(); +} + +main(); diff --git a/packages/google-cloud-mediatranslation/system-test/install.ts b/packages/google-cloud-mediatranslation/system-test/install.ts new file mode 100644 index 00000000000..c9aa74ec221 --- /dev/null +++ b/packages/google-cloud-mediatranslation/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); diff --git a/packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts new file mode 100644 index 00000000000..0b6bec1bc3a --- /dev/null +++ b/packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts @@ -0,0 +1,181 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const speechtranslationserviceModule = require('../src'); + +import {PassThrough} from 'stream'; + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockBidiStreamingGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return () => { + const mockStream = new PassThrough({ + objectMode: true, + transform: (chunk: {}, enc: {}, callback: Callback) => { + assert.deepStrictEqual(chunk, expectedRequest); + if (error) { + callback(error); + } else { + callback(null, response); + } + }, + }); + return mockStream; + }; +} +describe('v1beta1.SpeechTranslationServiceClient', () => { + it('has servicePath', () => { + const servicePath = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + it('has initialize method and supports deferred initialization', async () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.speechTranslationServiceStub, undefined); + await client.initialize(); + assert(client.speechTranslationServiceStub); + }); + it('has close method', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + describe('streamingTranslateSpeech', () => { + it('invokes streamingTranslateSpeech without error', done => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.streamingTranslateSpeech = mockBidiStreamingGrpcMethod( + request, + expectedResponse, + null + ); + const stream = client + .streamingTranslateSpeech() + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + it('invokes streamingTranslateSpeech with error', done => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.streamingTranslateSpeech = mockBidiStreamingGrpcMethod( + request, + null, + error + ); + const stream = client + .streamingTranslateSpeech() + .on('data', () => { + assert.fail(); + }) + .on('error', (err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + stream.write(request); + }); + }); +}); diff --git a/packages/google-cloud-mediatranslation/tsconfig.json b/packages/google-cloud-mediatranslation/tsconfig.json new file mode 100644 index 00000000000..613d35597b5 --- /dev/null +++ b/packages/google-cloud-mediatranslation/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2016", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-mediatranslation/tslint.json b/packages/google-cloud-mediatranslation/tslint.json new file mode 100644 index 00000000000..617dc975bae --- /dev/null +++ b/packages/google-cloud-mediatranslation/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} diff --git a/packages/google-cloud-mediatranslation/webpack.config.js b/packages/google-cloud-mediatranslation/webpack.config.js new file mode 100644 index 00000000000..008381a7fc8 --- /dev/null +++ b/packages/google-cloud-mediatranslation/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'SpeechTranslationService', + filename: './speech-translation-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 b089e0be7e066f6d329651deb43dde413456cd96 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 19 Mar 2020 22:19:06 +0100 Subject: [PATCH 003/147] chore(deps): update dependency mocha to v7 (#5) --- packages/google-cloud-mediatranslation/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index dcbd296eaf9..28fb4682d33 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -29,7 +29,7 @@ "google-gax": "^1.14.2" }, "devDependencies": { - "@types/mocha": "^5.2.7", + "@types/mocha": "^7.0.0", "@types/node": "^12.12.29", "c8": "^7.1.0", "eslint": "^6.8.0", @@ -41,7 +41,7 @@ "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.3", - "mocha": "^6.2.2", + "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "prettier": "^1.19.1", From e958d93c2a3989e592b0138555354f9566251b8f Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 23 Mar 2020 17:45:02 -0700 Subject: [PATCH 004/147] docs: document version support goals (#11) --- .../google-cloud-mediatranslation/README.md | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index dcd7093a245..ad7f0cda0ed 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -55,18 +55,18 @@ npm install @google-cloud/media-translation ### Using the client library ```javascript - // Imports the Google Cloud client library - const { - SpeechTranslationServiceClient, - } = require('@google-cloud/media-translation'); +// Imports the Google Cloud client library +const { + SpeechTranslationServiceClient, +} = require('@google-cloud/media-translation'); - // Creates a client - const translate = new SpeechTranslationServiceClient(); +// Creates a client +const translate = new SpeechTranslationServiceClient(); - // parent = 'projects/my-project', // Project to list dashboards for. +// parent = 'projects/my-project', // Project to list dashboards for. - // TODO: add an actual sample. - console.info(translate); +// TODO: add an actual sample. +console.info(translate); ``` @@ -87,6 +87,27 @@ has instructions for running the samples. The [Cloud Media Translation Node.js Client API Reference][client-docs] documentation also contains samples. +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. + +Client libraries targetting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + ## Versioning This library follows [Semantic Versioning](http://semver.org/). From 3453f449c0719ebc5d50f82ca3d105f5710d825f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2020 12:22:03 -0700 Subject: [PATCH 005/147] chore: release 1.0.0 (#4) --- packages/google-cloud-mediatranslation/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-mediatranslation/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-mediatranslation/CHANGELOG.md diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md new file mode 100644 index 00000000000..2471a641144 --- /dev/null +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +## 1.0.0 (2020-03-24) + + +### ⚠ BREAKING CHANGES + +* initial library generation (#1) + +### Features + +* initial library generation ([#1](https://www.github.com/googleapis/nodejs-media-translation/issues/1)) ([33bc8b9](https://www.github.com/googleapis/nodejs-media-translation/commit/33bc8b9469fde7f0d55b7445d2f63e772ed76fee)) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 28fb4682d33..66943f24377 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "0.1.0", + "version": "1.0.0", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index cd505f739b1..3cb8e4f5a53 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^0.1.0" + "@google-cloud/media-translation": "^1.0.0" }, "devDependencies": { "c8": "^7.0.0", From 4c1cad64c8a68701e69c2edfc85112f260e52c28 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Tue, 24 Mar 2020 13:41:43 -0700 Subject: [PATCH 006/147] feat: adds media translation file, mic samples * feat: adds streaming samples * fix: linter errors * fix: per reviewer * fix: per reviewer * fix: updates package.json --- .../samples/package.json | 3 +- .../samples/quickstart.js | 91 ++++++++++++++++--- .../{quickstart.js => quickstart.test.js} | 25 ++--- 3 files changed, 89 insertions(+), 30 deletions(-) rename packages/google-cloud-mediatranslation/samples/test/{quickstart.js => quickstart.test.js} (56%) diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 3cb8e4f5a53..017cda4def5 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,8 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^1.0.0" + "@google-cloud/media-translation": "^1.0.0", + "node-record-lpcm16": "1.0.1" }, "devDependencies": { "c8": "^7.0.0", diff --git a/packages/google-cloud-mediatranslation/samples/quickstart.js b/packages/google-cloud-mediatranslation/samples/quickstart.js index a10a56d3f15..6d32bdc92eb 100644 --- a/packages/google-cloud-mediatranslation/samples/quickstart.js +++ b/packages/google-cloud-mediatranslation/samples/quickstart.js @@ -1,38 +1,101 @@ -// Copyright 2020 Google LLC -// +// Copyright 2020, Google LLC. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://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. -// 'use strict'; -async function quickstart() { - // parent = 'projects/my-project' // Project to list dashboards for. +/** + * Translate text from an audio file. + * @param {string} filename local path to + * @param {string} encoding the encoding of the audio rate, e.g. Linear16 + * @param {string} sourceLanguage language translating from, as BCP-47 code + * @param {string} targetLanguage languate translating to, as BCP-47 code + */ +function main(filename, encoding, sourceLanguage, targetLanguage) { // [START media_translation_quickstart] - // Imports the Google Cloud client library + const fs = require('fs'); + + // Imports the CLoud Media Translation client library const { SpeechTranslationServiceClient, } = require('@google-cloud/media-translation'); // Creates a client - const translate = new SpeechTranslationServiceClient(); + const client = new SpeechTranslationServiceClient(); + + async function quickstart() { + /** + * TODO(developer): Uncomment the following lines before running the sample. + */ + // const filename = 'Local path to audio file, e.g. /path/to/audio.raw'; + // const encoding = 'Encoding of the audio file, e.g. LINEAR16'; + // const sourceLanguage = 'BCP-47 source language code, e.g. en-US'; + // const targetLangauge = 'BCP-47 target language code, e.g. es-ES'; + + const config = { + audioConfig: { + audioEncoding: encoding, + sourceLanguageCode: sourceLanguage, + targetLanguageCode: targetLanguage, + }, + }; + + // First request needs to have only a streaming config, no data. + const initialRequest = { + streamingConfig: config, + audioContent: null, + }; + + const readStream = fs.createReadStream(filename, { + highWaterMark: 4096, + encoding: 'base64', + }); - // parent = 'projects/my-project', // Project to list dashboards for. + const chunks = []; + readStream + .on('data', chunk => { + const request = { + streamingConfig: config, + audioContent: chunk.toString(), + }; + chunks.push(request); + }) + .on('close', () => { + // Config-only request should be first in stream of requests + stream.write(initialRequest); + for (let i = 0; i < chunks.length; i++) { + stream.write(chunks[i]); + } + stream.end(); + }); - // TODO: add an actual sample. - console.info(translate); + const stream = client.streamingTranslateSpeech().on('data', response => { + const {result} = response; + if (result.textTranslationResult.isFinal) { + console.log( + `\nFinal translation: ${result.textTranslationResult.translation}` + ); + console.log(`Final recognition result: ${result.recognitionResult}`); + } else { + console.log( + `\nPartial translation: ${result.textTranslationResult.translation}` + ); + console.log(`Partial recognition result: ${result.recognitionResult}`); + } + }); - // [END media_translation_quickstart] + // [END media_translation_quickstart] + } + quickstart(); } -const args = process.argv.slice(2); -quickstart(...args).catch(console.error); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-mediatranslation/samples/test/quickstart.js b/packages/google-cloud-mediatranslation/samples/test/quickstart.test.js similarity index 56% rename from packages/google-cloud-mediatranslation/samples/test/quickstart.js rename to packages/google-cloud-mediatranslation/samples/test/quickstart.test.js index 6fdf66492e8..c031c441297 100644 --- a/packages/google-cloud-mediatranslation/samples/test/quickstart.js +++ b/packages/google-cloud-mediatranslation/samples/test/quickstart.test.js @@ -1,36 +1,31 @@ -// Copyright 2020 Google LLC +// Copyright 2017 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// 'use strict'; const path = require('path'); const {assert} = require('chai'); -const cp = require('child_process'); const {describe, it} = require('mocha'); +const execSync = require('child_process').execSync; +const cmd = 'node quickstart.js'; -const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); - -const cwd = path.join(__dirname, '..'); - -const PROJECT_ID = process.env.GCLOUD_PROJECT; +const filePath = path.join(__dirname, '..', 'resources/audio.raw'); +const exec = cmd => execSync(cmd, {encoding: 'utf-8'}); -describe('Sample Integration Tests', () => { - it('should run quickstart.js', async () => { - const stdout = execSync(`node ./quickstart.js projects/${PROJECT_ID}`, { - cwd, - }); - assert(stdout); +describe('Quickstart', () => { + it('should translate from a streamed file', async () => { + const stdout = exec(`${cmd} ${filePath} linear16 en-US es-ES`); + assert.include(stdout, 'Partial translation'); }); }); From 73b65dd3916c681fef047cfabe1c349cefeebda3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Mar 2020 10:07:57 -0700 Subject: [PATCH 007/147] chore: regenerate the code (#10) * [CHANGE ME] Re-generated to pick up changes in the API or client library generator. * chore: remove check on docs site, as it doesn't exist Co-authored-by: Alexander Fenster Co-authored-by: bcoe --- packages/google-cloud-mediatranslation/.jsdoc.js | 2 +- .../linkinator.config.json | 5 +---- .../google-cloud-mediatranslation/src/index.ts | 2 +- .../src/v1beta1/index.ts | 2 +- .../v1beta1/speech_translation_service_client.ts | 12 +++++++++--- .../google-cloud-mediatranslation/synth.metadata | 14 +++++++++++--- packages/google-cloud-mediatranslation/synth.py | 4 ++-- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- .../gapic-speech_translation_service-v1beta1.ts | 2 +- .../webpack.config.js | 2 +- 12 files changed, 31 insertions(+), 20 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.jsdoc.js b/packages/google-cloud-mediatranslation/.jsdoc.js index f0b72506ae9..fa2dda46066 100644 --- a/packages/google-cloud-mediatranslation/.jsdoc.js +++ b/packages/google-cloud-mediatranslation/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/linkinator.config.json b/packages/google-cloud-mediatranslation/linkinator.config.json index 3d251c6f25f..06a195b13fe 100644 --- a/packages/google-cloud-mediatranslation/linkinator.config.json +++ b/packages/google-cloud-mediatranslation/linkinator.config.json @@ -4,10 +4,7 @@ "https://codecov.io/gh/googleapis/", "www.googleapis.com", "img.shields.io", - "https://googleapis.dev/nodejs/mediatranslation/latest", - "https://github.com/googleapis/nodejs-media-translation/tree/master/samples", - "https://github.com/googleapis/nodejs-media-translation/blob/master/samples/quickstart.js", - "https://cloud.google.com/mediatranslation/docs/" + "https://cloud.google.com/mediatranslation/docs" ], "silent": true, "concurrency": 10 diff --git a/packages/google-cloud-mediatranslation/src/index.ts b/packages/google-cloud-mediatranslation/src/index.ts index 5429fa7b1a1..c3875b5ce35 100644 --- a/packages/google-cloud-mediatranslation/src/index.ts +++ b/packages/google-cloud-mediatranslation/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/index.ts b/packages/google-cloud-mediatranslation/src/v1beta1/index.ts index 9a17d1ffd7b..2a0ce60a0cc 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/index.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 55232716eb8..645b2fd5ff1 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -37,7 +37,12 @@ const version = require('../../../package.json').version; * @memberof v1beta1 */ export class SpeechTranslationServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _terminated = false; private _opts: ClientOptions; @@ -204,7 +209,8 @@ export class SpeechTranslationServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index fa0f49ccb2a..28e7ffc4731 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -1,12 +1,20 @@ { - "updateTime": "2020-03-19T01:33:51.859054Z", + "updateTime": "2020-03-22T11:35:49.975575Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "275fbcce2c900278d487c33293a3c7e1fbcd3a34", - "internalRef": "301661567" + "sha": "0be7105dc52590fa9a24e784052298ae37ce53aa", + "internalRef": "302154871", + "log": "0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" } } ], diff --git a/packages/google-cloud-mediatranslation/synth.py b/packages/google-cloud-mediatranslation/synth.py index a344de4b14b..4de45a0927d 100644 --- a/packages/google-cloud-mediatranslation/synth.py +++ b/packages/google-cloud-mediatranslation/synth.py @@ -34,12 +34,12 @@ extra_proto_files=['google/cloud/common_resources.proto'], proto_path=f'/google/cloud/{name}/{version}', version=version) -s.copy(library, excludes=['package.json', 'README.md']) +s.copy(library, excludes=['linkinator.config.json', 'package.json', 'README.md']) # Copy common templates common_templates = gcp.CommonTemplates() templates = common_templates.node_library(source_location='build/src') -s.copy(templates, excludes=[]) +s.copy(templates, excludes=['linkinator.config.json']) # Node.js specific cleanup subprocess.run(['npm', 'install']) diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js index dd96f9de622..4bdd1de43c9 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts index b0daa946915..7a0e8d9cefc 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/system-test/install.ts b/packages/google-cloud-mediatranslation/system-test/install.ts index c9aa74ec221..c4d80e9c0c8 100644 --- a/packages/google-cloud-mediatranslation/system-test/install.ts +++ b/packages/google-cloud-mediatranslation/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts index 0b6bec1bc3a..41f5558ceb2 100644 --- a/packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts +++ b/packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/webpack.config.js b/packages/google-cloud-mediatranslation/webpack.config.js index 008381a7fc8..f1a3ef3de23 100644 --- a/packages/google-cloud-mediatranslation/webpack.config.js +++ b/packages/google-cloud-mediatranslation/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 290baaf04b8ca00710116840eedd760a85854326 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 31 Mar 2020 18:36:54 -0700 Subject: [PATCH 008/147] build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#15) --- packages/google-cloud-mediatranslation/synth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/google-cloud-mediatranslation/synth.py b/packages/google-cloud-mediatranslation/synth.py index 4de45a0927d..ecfa356e17e 100644 --- a/packages/google-cloud-mediatranslation/synth.py +++ b/packages/google-cloud-mediatranslation/synth.py @@ -20,6 +20,9 @@ logging.basicConfig(level=logging.DEBUG) +AUTOSYNTH_MULTIPLE_COMMITS = True + + # run the gapic generator gapic = gcp.GAPICMicrogenerator() versions = ['v1beta1'] From 7cb21ac891d7f7740b840c3e34ac6c2bbb06b78d Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Wed, 1 Apr 2020 17:00:16 -0700 Subject: [PATCH 009/147] feat!: drop node8 support (#17) BREAKING CHANGE: The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. --- .../.eslintrc.json | 3 + .../.eslintrc.yml | 15 -- .../google-cloud-mediatranslation/.prettierrc | 8 - .../.prettierrc.js | 17 ++ .../google-cloud-mediatranslation/README.md | 74 +++++- .../package.json | 10 +- .../samples/README.md | 36 +++ .../src/index.ts | 2 - .../speech_translation_service_client.ts | 56 ++-- .../synth.metadata | 20 +- .../system-test/fixtures/sample/src/index.js | 1 - .../system-test/fixtures/sample/src/index.ts | 2 +- ...apic-speech_translation_service-v1beta1.ts | 181 ------------- ...apic_speech_translation_service_v1beta1.ts | 248 ++++++++++++++++++ .../webpack.config.js | 12 +- 15 files changed, 408 insertions(+), 277 deletions(-) create mode 100644 packages/google-cloud-mediatranslation/.eslintrc.json delete mode 100644 packages/google-cloud-mediatranslation/.eslintrc.yml delete mode 100644 packages/google-cloud-mediatranslation/.prettierrc create mode 100644 packages/google-cloud-mediatranslation/.prettierrc.js delete mode 100644 packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts create mode 100644 packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts diff --git a/packages/google-cloud-mediatranslation/.eslintrc.json b/packages/google-cloud-mediatranslation/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-mediatranslation/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-mediatranslation/.eslintrc.yml b/packages/google-cloud-mediatranslation/.eslintrc.yml deleted file mode 100644 index 73eeec27612..00000000000 --- a/packages/google-cloud-mediatranslation/.eslintrc.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -extends: - - 'eslint:recommended' - - 'plugin:node/recommended' - - prettier -plugins: - - node - - prettier -rules: - prettier/prettier: error - block-scoped-var: error - eqeqeq: error - no-warning-comments: warn - no-var: error - prefer-const: error diff --git a/packages/google-cloud-mediatranslation/.prettierrc b/packages/google-cloud-mediatranslation/.prettierrc deleted file mode 100644 index df6eac07446..00000000000 --- a/packages/google-cloud-mediatranslation/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ ---- -bracketSpacing: false -printWidth: 80 -semi: true -singleQuote: true -tabWidth: 2 -trailingComma: es5 -useTabs: false diff --git a/packages/google-cloud-mediatranslation/.prettierrc.js b/packages/google-cloud-mediatranslation/.prettierrc.js new file mode 100644 index 00000000000..08cba3775be --- /dev/null +++ b/packages/google-cloud-mediatranslation/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index ad7f0cda0ed..e7f19289e5c 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -55,18 +55,76 @@ npm install @google-cloud/media-translation ### Using the client library ```javascript -// Imports the Google Cloud client library +const fs = require('fs'); + +// Imports the CLoud Media Translation client library const { SpeechTranslationServiceClient, } = require('@google-cloud/media-translation'); // Creates a client -const translate = new SpeechTranslationServiceClient(); - -// parent = 'projects/my-project', // Project to list dashboards for. - -// TODO: add an actual sample. -console.info(translate); +const client = new SpeechTranslationServiceClient(); + +async function quickstart() { + /** + * TODO(developer): Uncomment the following lines before running the sample. + */ + // const filename = 'Local path to audio file, e.g. /path/to/audio.raw'; + // const encoding = 'Encoding of the audio file, e.g. LINEAR16'; + // const sourceLanguage = 'BCP-47 source language code, e.g. en-US'; + // const targetLangauge = 'BCP-47 target language code, e.g. es-ES'; + + const config = { + audioConfig: { + audioEncoding: encoding, + sourceLanguageCode: sourceLanguage, + targetLanguageCode: targetLanguage, + }, + }; + + // First request needs to have only a streaming config, no data. + const initialRequest = { + streamingConfig: config, + audioContent: null, + }; + + const readStream = fs.createReadStream(filename, { + highWaterMark: 4096, + encoding: 'base64', + }); + + const chunks = []; + readStream + .on('data', chunk => { + const request = { + streamingConfig: config, + audioContent: chunk.toString(), + }; + chunks.push(request); + }) + .on('close', () => { + // Config-only request should be first in stream of requests + stream.write(initialRequest); + for (let i = 0; i < chunks.length; i++) { + stream.write(chunks[i]); + } + stream.end(); + }); + + const stream = client.streamingTranslateSpeech().on('data', response => { + const {result} = response; + if (result.textTranslationResult.isFinal) { + console.log( + `\nFinal translation: ${result.textTranslationResult.translation}` + ); + console.log(`Final recognition result: ${result.recognitionResult}`); + } else { + console.log( + `\nPartial translation: ${result.textTranslationResult.translation}` + ); + console.log(`Partial recognition result: ${result.recognitionResult}`); + } + }); ``` @@ -81,6 +139,8 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | | Quickstart | [source code](https://github.com/googleapis/nodejs-media-translation/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-media-translation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Translate_from_file | [source code](https://github.com/googleapis/nodejs-media-translation/blob/master/samples/translate_from_file.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_file.js,samples/README.md) | +| Translate_from_mic | [source code](https://github.com/googleapis/nodejs-media-translation/blob/master/samples/translate_from_mic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_mic.js,samples/README.md) | diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 66943f24377..7dff99ca857 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -26,17 +26,18 @@ "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" }, "dependencies": { - "google-gax": "^1.14.2" + "google-gax": "^2.0.1" }, "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.12.29", + "@types/sinon": "^9.0.0", "c8": "^7.1.0", "eslint": "^6.8.0", "eslint-config-prettier": "^6.10.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.1.2", - "gts": "^1.1.2", + "gts": "2.0.0-alpha.9", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", @@ -45,12 +46,13 @@ "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "prettier": "^1.19.1", + "sinon": "^9.0.1", "ts-loader": "^6.2.1", - "typescript": "~3.7.5", + "typescript": "^3.8.3", "webpack": "^4.42.0", "webpack-cli": "^3.3.11" }, "engines": { - "node": ">=8.13.0" + "node": ">=10" } } diff --git a/packages/google-cloud-mediatranslation/samples/README.md b/packages/google-cloud-mediatranslation/samples/README.md index 6457b141329..b43a37315fc 100644 --- a/packages/google-cloud-mediatranslation/samples/README.md +++ b/packages/google-cloud-mediatranslation/samples/README.md @@ -13,6 +13,8 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) * [Quickstart](#quickstart) + * [Translate_from_file](#translate_from_file) + * [Translate_from_mic](#translate_from_mic) ## Before you begin @@ -41,6 +43,40 @@ __Usage:__ `node samples/quickstart.js` +----- + + + + +### Translate_from_file + +View the [source code](https://github.com/googleapis/nodejs-media-translation/blob/master/samples/translate_from_file.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_file.js,samples/README.md) + +__Usage:__ + + +`node samples/translate_from_file.js` + + +----- + + + + +### Translate_from_mic + +View the [source code](https://github.com/googleapis/nodejs-media-translation/blob/master/samples/translate_from_mic.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_mic.js,samples/README.md) + +__Usage:__ + + +`node samples/translate_from_mic.js` + + diff --git a/packages/google-cloud-mediatranslation/src/index.ts b/packages/google-cloud-mediatranslation/src/index.ts index c3875b5ce35..c2bc720e777 100644 --- a/packages/google-cloud-mediatranslation/src/index.ts +++ b/packages/google-cloud-mediatranslation/src/index.ts @@ -19,8 +19,6 @@ import * as v1beta1 from './v1beta1'; const SpeechTranslationServiceClient = v1beta1.SpeechTranslationServiceClient; export {v1beta1, SpeechTranslationServiceClient}; -// For compatibility with JavaScript libraries we need to provide this default export: -// tslint:disable-next-line no-default-export export default {v1beta1, SpeechTranslationServiceClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 645b2fd5ff1..97f5eb2d3fd 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -17,16 +17,10 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import { - APICallback, - Callback, - CallOptions, - Descriptors, - ClientOptions, -} from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; -import * as protosTypes from '../../protos/protos'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './speech_translation_service_client_config.json'; const version = require('../../../package.json').version; @@ -37,13 +31,6 @@ const version = require('../../../package.json').version; * @memberof v1beta1 */ export class SpeechTranslationServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -51,6 +38,13 @@ export class SpeechTranslationServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; speechTranslationServiceStub?: Promise<{[name: string]: Function}>; /** @@ -144,12 +138,15 @@ export class SpeechTranslationServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // Some of the methods on this service provide streaming responses. // Provide descriptors for these. - this._descriptors.stream = { + this.descriptors.stream = { streamingTranslateSpeech: new this._gaxModule.StreamDescriptor( gax.StreamType.BIDI_STREAMING ), @@ -166,7 +163,7 @@ export class SpeechTranslationServiceClient { // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. - this._innerApiCalls = {}; + this.innerApiCalls = {}; } /** @@ -193,7 +190,7 @@ export class SpeechTranslationServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.mediatranslation.v1beta1.SpeechTranslationService' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.mediatranslation.v1beta1 .SpeechTranslationService, this._opts @@ -202,9 +199,8 @@ export class SpeechTranslationServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const speechTranslationServiceStubMethods = ['streamingTranslateSpeech']; - for (const methodName of speechTranslationServiceStubMethods) { - const innerCallPromise = this.speechTranslationServiceStub.then( + const callPromise = this.speechTranslationServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -218,20 +214,14 @@ export class SpeechTranslationServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.speechTranslationServiceStub; @@ -301,7 +291,7 @@ export class SpeechTranslationServiceClient { */ streamingTranslateSpeech(options?: gax.CallOptions): gax.CancellableStream { this.initialize(); - return this._innerApiCalls.streamingTranslateSpeech(options); + return this.innerApiCalls.streamingTranslateSpeech(options); } /** diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 28e7ffc4731..5a88cbcdfc9 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -1,23 +1,5 @@ { - "updateTime": "2020-03-22T11:35:49.975575Z", - "sources": [ - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0be7105dc52590fa9a24e784052298ae37ce53aa", - "internalRef": "302154871", - "log": "0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" - } - } - ], + "updateTime": "2020-04-01T23:52:56.801063Z", "destinations": [ { "client": { diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js index 4bdd1de43c9..69241f359d5 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js @@ -16,7 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** - /* eslint-disable node/no-missing-require, no-unused-vars */ const mediatranslation = require('@google-cloud/media-translation'); diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts index 7a0e8d9cefc..41e2683eee2 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts @@ -19,7 +19,7 @@ import {SpeechTranslationServiceClient} from '@google-cloud/media-translation'; function main() { - const speechTranslationServiceClient = new SpeechTranslationServiceClient(); + new SpeechTranslationServiceClient(); } main(); diff --git a/packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts deleted file mode 100644 index 41f5558ceb2..00000000000 --- a/packages/google-cloud-mediatranslation/test/gapic-speech_translation_service-v1beta1.ts +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const speechtranslationserviceModule = require('../src'); - -import {PassThrough} from 'stream'; - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockBidiStreamingGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return () => { - const mockStream = new PassThrough({ - objectMode: true, - transform: (chunk: {}, enc: {}, callback: Callback) => { - assert.deepStrictEqual(chunk, expectedRequest); - if (error) { - callback(error); - } else { - callback(null, response); - } - }, - }); - return mockStream; - }; -} -describe('v1beta1.SpeechTranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient - .servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = - speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient - .port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - fallback: true, - } - ); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.speechTranslationServiceStub, undefined); - await client.initialize(); - assert(client.speechTranslationServiceStub); - }); - it('has close method', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.close(); - }); - describe('streamingTranslateSpeech', () => { - it('invokes streamingTranslateSpeech without error', done => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest = {}; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.streamingTranslateSpeech = mockBidiStreamingGrpcMethod( - request, - expectedResponse, - null - ); - const stream = client - .streamingTranslateSpeech() - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(request); - }); - it('invokes streamingTranslateSpeech with error', done => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechRequest = {}; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.streamingTranslateSpeech = mockBidiStreamingGrpcMethod( - request, - null, - error - ); - const stream = client - .streamingTranslateSpeech() - .on('data', () => { - assert.fail(); - }) - .on('error', (err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - stream.write(request); - }); - }); -}); diff --git a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts new file mode 100644 index 00000000000..e5adba79cf7 --- /dev/null +++ b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts @@ -0,0 +1,248 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as speechtranslationserviceModule 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 stubBidiStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +describe('v1beta1.SpeechTranslationServiceClient', () => { + it('has servicePath', () => { + const servicePath = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.speechTranslationServiceStub, undefined); + await client.initialize(); + assert(client.speechTranslationServiceStub); + }); + + it('has close method', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + 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 speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + 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('streamingTranslateSpeech', () => { + it('invokes streamingTranslateSpeech without error', async () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse() + ); + client.innerApiCalls.streamingTranslateSpeech = stubBidiStreamingCall( + expectedResponse + ); + const stream = client.streamingTranslateSpeech(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.streamingTranslateSpeech as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( + 0 + ).args[0], + request + ); + }); + + it('invokes streamingTranslateSpeech with error', async () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingTranslateSpeech = stubBidiStreamingCall( + undefined, + expectedError + ); + const stream = client.streamingTranslateSpeech(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.innerApiCalls.streamingTranslateSpeech as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( + 0 + ).args[0], + request + ); + }); + }); +}); diff --git a/packages/google-cloud-mediatranslation/webpack.config.js b/packages/google-cloud-mediatranslation/webpack.config.js index f1a3ef3de23..4d45979f371 100644 --- a/packages/google-cloud-mediatranslation/webpack.config.js +++ b/packages/google-cloud-mediatranslation/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]grpc/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader' + use: 'null-loader', }, ], }, From 645c7d50f716a3759c2ab45627259df6ec4090b8 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 5 Apr 2020 12:50:00 -0700 Subject: [PATCH 010/147] chore: remove duplicate mocha config (#19) --- packages/google-cloud-mediatranslation/.mocharc.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 packages/google-cloud-mediatranslation/.mocharc.json diff --git a/packages/google-cloud-mediatranslation/.mocharc.json b/packages/google-cloud-mediatranslation/.mocharc.json deleted file mode 100644 index 670c5e2c24b..00000000000 --- a/packages/google-cloud-mediatranslation/.mocharc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} From 0cf8b6c4ae0e9b144bd809ec0779d0f3ac12daf2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2020 17:05:34 -0700 Subject: [PATCH 011/147] chore: release 2.0.0 (#18) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-mediatranslation/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-mediatranslation/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index 2471a641144..527c829a23f 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.0.0](https://www.github.com/googleapis/nodejs-media-translation/compare/v1.0.0...v2.0.0) (2020-04-05) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* adds media translation file, mic samples ([db91593](https://www.github.com/googleapis/nodejs-media-translation/commit/db915930164484cc016dcb5fbe215d9eef00b412)) +* drop node8 support ([#17](https://www.github.com/googleapis/nodejs-media-translation/issues/17)) ([b662dc6](https://www.github.com/googleapis/nodejs-media-translation/commit/b662dc61e43c34b1c56f156eb18d0bbf98170e59)) + ## 1.0.0 (2020-03-24) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 7dff99ca857..070cd4b91a6 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "1.0.0", + "version": "2.0.0", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 017cda4def5..8d6089f04e0 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^1.0.0", + "@google-cloud/media-translation": "^2.0.0", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From e5ef003783fc14f4991a7ef94586795d23978a21 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Apr 2020 20:57:38 +0200 Subject: [PATCH 012/147] chore(deps): update dependency gts to v2.0.0 (#23) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [gts](https://togithub.com/google/gts) | devDependencies | patch | [`2.0.0-alpha.9` -> `2.0.0`](https://renovatebot.com/diffs/npm/gts/2.0.0-alpha.9/2.0.0) | --- ### Release Notes
google/gts ### [`v2.0.0`](https://togithub.com/google/gts/blob/master/CHANGELOG.md#​200-httpswwwgithubcomgooglegtscomparev112v200-2020-04-02) [Compare Source](https://togithub.com/google/gts/compare/39a2705e51b4b6329a70f91f8293a2d7a363bf5d...v2.0.0) ##### ⚠ BREAKING CHANGES ⚠ This is a major rewrite of the tool. Based on community guidance, we've switched from using [tslint](https://palantir.github.io/tslint/) to [eslint](https://eslint.org/). _Please read all of the steps below to upgrade_. ##### Configuring `eslint` With the shift to `eslint`, `gts` now will format and lint JavaScript _as well_ as TypeScript. Upgrading will require a number of manual steps. To format JavaScript and TypeScript, you can run: $ npx gts fix To specify only TypeScript: $ npx gts fix '**/*.ts' ##### Delete `tslint.json` This file is no longer used, and can lead to confusion. ##### Create a `.eslintrc.json` Now that we're using eslint, you need to extend the eslint configuration baked into the module. Create a new file named `.eslintrc.json`, and paste the following: ```js { "extends": "./node_modules/gts" } ``` ##### Create a `.eslintignore` The `.eslintignore` file lets you ignore specific directories. This tool now lints and formats JavaScript, so it's _really_ important to ignore your build directory! Here is an example of a `.eslintignore` file: **/node_modules build/ ##### Rule changes The underlying linter was changed, so naturally there are going to be a variety of rule changes along the way. To see the full list, check out [.eslintrc.json](https://togithub.com/google/gts/blob/master/.eslintrc.json). ##### Require Node.js 10.x and up Node.js 8.x is now end of life - this module now requires Ndoe.js 10.x and up. ##### Features - add the eol-last rule ([#​425](https://www.github.com/google/gts/issues/425)) ([50ebd4d](https://www.github.com/google/gts/commit/50ebd4dbaf063615f4c025f567ca28076a734223)) - allow eslintrc to run over tsx files ([#​469](https://www.github.com/google/gts/issues/469)) ([a21db94](https://www.github.com/google/gts/commit/a21db94601def563952d677cb0980a12b6730f4c)) - disable global rule for checking TODO comments ([#​459](https://www.github.com/google/gts/issues/459)) ([96aa84a](https://www.github.com/google/gts/commit/96aa84a0a42181046daa248750cc8fef0c320619)) - override require-atomic-updates ([#​468](https://www.github.com/google/gts/issues/468)) ([8105c93](https://www.github.com/google/gts/commit/8105c9334ee5104b05f6b1b2f150e51419637262)) - prefer single quotes if possible ([#​475](https://www.github.com/google/gts/issues/475)) ([39a2705](https://www.github.com/google/gts/commit/39a2705e51b4b6329a70f91f8293a2d7a363bf5d)) - use eslint instead of tslint ([#​400](https://www.github.com/google/gts/issues/400)) ([b3096fb](https://www.github.com/google/gts/commit/b3096fbd5076d302d93c2307bf627e12c423e726)) ##### Bug Fixes - use .prettierrc.js ([#​437](https://www.github.com/google/gts/issues/437)) ([06efa84](https://www.github.com/google/gts/commit/06efa8444cdf1064b64f3e8d61ebd04f45d90b4c)) - **deps:** update dependency chalk to v4 ([#​477](https://www.github.com/google/gts/issues/477)) ([061d64e](https://www.github.com/google/gts/commit/061d64e29d37b93ce55228937cc100e05ddef352)) - **deps:** update dependency eslint-plugin-node to v11 ([#​426](https://www.github.com/google/gts/issues/426)) ([a394b7c](https://www.github.com/google/gts/commit/a394b7c1f80437f25017ca5c500b968ebb789ece)) - **deps:** update dependency execa to v4 ([#​427](https://www.github.com/google/gts/issues/427)) ([f42ef36](https://www.github.com/google/gts/commit/f42ef36709251553342e655e287e889df72ee3e3)) - **deps:** update dependency prettier to v2 ([#​464](https://www.github.com/google/gts/issues/464)) ([20ef43d](https://www.github.com/google/gts/commit/20ef43d566df17d3c93949ef7db3b72ee9123ca3)) - disable no-use-before-define ([#​431](https://www.github.com/google/gts/issues/431)) ([dea2c22](https://www.github.com/google/gts/commit/dea2c223d1d3a60a1786aa820eebb93be27016a7)) - **deps:** update dependency update-notifier to v4 ([#​403](https://www.github.com/google/gts/issues/403)) ([57393b7](https://www.github.com/google/gts/commit/57393b74c6cf299e8ae09311f0382226b8baa3e3)) - **deps:** upgrade to meow 6.x ([#​423](https://www.github.com/google/gts/issues/423)) ([8f93d00](https://www.github.com/google/gts/commit/8f93d0049337a832d9a22b6ae4e86fd41140ec56)) - align back to the google style guide ([#​440](https://www.github.com/google/gts/issues/440)) ([8bd78c4](https://www.github.com/google/gts/commit/8bd78c4c78526a72400f618a95a987d2a7c1a8db)) - disable empty-function check ([#​467](https://www.github.com/google/gts/issues/467)) ([6455d7a](https://www.github.com/google/gts/commit/6455d7a9d227320d3ffe1b00c9c739b846f339a8)) - drop support for node 8 ([#​422](https://www.github.com/google/gts/issues/422)) ([888c686](https://www.github.com/google/gts/commit/888c68692079065f38ce66ec84472f1f3311a050)) - emit .prettierrc.js with init ([#​462](https://www.github.com/google/gts/issues/462)) ([b114614](https://www.github.com/google/gts/commit/b114614d22ab5560d2d1dd5cb6695968cc80027b)) - enable trailing comma ([#​470](https://www.github.com/google/gts/issues/470)) ([6518f58](https://www.github.com/google/gts/commit/6518f5843d3093e3beb7d3371b56d9aecedf3924)) - include _.tsx and _.jsx in default fix command ([#​473](https://www.github.com/google/gts/issues/473)) ([0509780](https://www.github.com/google/gts/commit/050978005ad089d9b3b5d8895b25ea1175d75db2)) ##### [1.1.2](https://www.github.com/google/gts/compare/v1.1.1...v1.1.2) (2019-11-20) ##### Bug Fixes - **deps:** update to newest prettier (with support for optional chain) ([#​396](https://www.github.com/google/gts/issues/396)) ([ce8ad06](https://www.github.com/google/gts/commit/ce8ad06c8489c44a9e2ed5292382637b3ebb7601)) ##### [1.1.1](https://www.github.com/google/gts/compare/v1.1.0...v1.1.1) (2019-11-11) ##### Bug Fixes - **deps:** update dependency chalk to v3 ([#​389](https://www.github.com/google/gts/issues/389)) ([1ce0f45](https://www.github.com/google/gts/commit/1ce0f450677e143a27efc39def617d13c66503e8)) - **deps:** update dependency inquirer to v7 ([#​377](https://www.github.com/google/gts/issues/377)) ([bf2c349](https://www.github.com/google/gts/commit/bf2c349b2208ac63e551542599ac9cd27b461338)) - **deps:** update dependency rimraf to v3 ([#​374](https://www.github.com/google/gts/issues/374)) ([2058eaa](https://www.github.com/google/gts/commit/2058eaa682f4baae978b469fd708d1f866e7da74)) - **deps:** update dependency write-file-atomic to v3 ([#​353](https://www.github.com/google/gts/issues/353)) ([59e6aa8](https://www.github.com/google/gts/commit/59e6aa8580a2f8e9457d2d2b6fa9e18e86347592))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 070cd4b91a6..3b059ac6844 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -37,7 +37,7 @@ "eslint-config-prettier": "^6.10.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.1.2", - "gts": "2.0.0-alpha.9", + "gts": "2.0.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", From 3d890c2a74cfd57cd5d32b2d1a467f4a2b10011c Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 10 Apr 2020 18:48:26 -0700 Subject: [PATCH 013/147] fix: remove eslint, update gax, fix generated protos, run the generator (#24) Run the latest version of the generator, update google-gax, update gts, and remove direct dependencies on eslint. --- .../google-cloud-mediatranslation/.jsdoc.js | 2 +- .../.prettierrc.js | 2 +- .../package.json | 14 +++++--------- .../protos/protos.js | 2 +- .../protos/protos.json | 1 + .../synth.metadata | 19 ++++++++++++++++++- .../google-cloud-mediatranslation/synth.py | 4 ++-- ...apic_speech_translation_service_v1beta1.ts | 2 +- 8 files changed, 30 insertions(+), 16 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.jsdoc.js b/packages/google-cloud-mediatranslation/.jsdoc.js index fa2dda46066..54cf7f15f1a 100644 --- a/packages/google-cloud-mediatranslation/.jsdoc.js +++ b/packages/google-cloud-mediatranslation/.jsdoc.js @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2019 Google, LLC.', + copyright: 'Copyright 2020 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/media-translation', diff --git a/packages/google-cloud-mediatranslation/.prettierrc.js b/packages/google-cloud-mediatranslation/.prettierrc.js index 08cba3775be..d1b95106f4c 100644 --- a/packages/google-cloud-mediatranslation/.prettierrc.js +++ b/packages/google-cloud-mediatranslation/.prettierrc.js @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 3b059ac6844..543e2f90dd3 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -20,24 +20,20 @@ "prepare": "npm run compile-protos && npm run compile", "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", - "fix": "gts fix && eslint samples --fix", - "lint": "gts check && eslint samples", - "prelint": "cd samples; npm link ../; npm i", + "fix": "gts fix", + "lint": "gts fix", + "prelint": "cd samples; npm link ../; npm install", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" }, "dependencies": { - "google-gax": "^2.0.1" + "google-gax": "^2.1.0" }, "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.12.29", "@types/sinon": "^9.0.0", "c8": "^7.1.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^3.1.2", - "gts": "2.0.0", + "gts": "^2.0.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index 33e7691527c..8fb32049b06 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + var $root = $protobuf.roots._google_cloud_media_translation_2_0_0_protos || ($protobuf.roots._google_cloud_media_translation_2_0_0_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-mediatranslation/protos/protos.json b/packages/google-cloud-mediatranslation/protos/protos.json index b73beda4e41..6694c3b1aa3 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.json +++ b/packages/google-cloud-mediatranslation/protos/protos.json @@ -1155,6 +1155,7 @@ }, "rpc": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", "java_multiple_files": true, "java_outer_classname": "StatusProto", diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 5a88cbcdfc9..09bf536d91a 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -1,5 +1,22 @@ { - "updateTime": "2020-04-01T23:52:56.801063Z", + "updateTime": "2020-04-11T01:36:16.535216Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "1bd77e8ce6f953ac641af7966d0c52646afc16a8", + "internalRef": "305974465" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5" + } + } + ], "destinations": [ { "client": { diff --git a/packages/google-cloud-mediatranslation/synth.py b/packages/google-cloud-mediatranslation/synth.py index ecfa356e17e..e8206509c1f 100644 --- a/packages/google-cloud-mediatranslation/synth.py +++ b/packages/google-cloud-mediatranslation/synth.py @@ -46,5 +46,5 @@ # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) - +subprocess.run(['npm', 'run', 'lint']) +subprocess.run(['npx', 'compileProtos', 'src']) diff --git a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts index e5adba79cf7..16437edcb1c 100644 --- a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts +++ b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts @@ -229,7 +229,7 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { stream.write(request); stream.end(); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( From 7eda7a72519f885c9e0d8635db8ad3476cf9aac8 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 11 Apr 2020 19:14:56 -0700 Subject: [PATCH 014/147] build: remove unused codecov config (#26) --- packages/google-cloud-mediatranslation/codecov.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 packages/google-cloud-mediatranslation/codecov.yaml diff --git a/packages/google-cloud-mediatranslation/codecov.yaml b/packages/google-cloud-mediatranslation/codecov.yaml deleted file mode 100644 index 5724ea9478d..00000000000 --- a/packages/google-cloud-mediatranslation/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com From 47c7229a86d847aff2f1713c804f123ffff16167 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 14:54:37 -0700 Subject: [PATCH 015/147] chore: update lint ignore files (#28) --- packages/google-cloud-mediatranslation/.eslintignore | 3 ++- packages/google-cloud-mediatranslation/.prettierignore | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.eslintignore b/packages/google-cloud-mediatranslation/.eslintignore index 09b31fe735a..9340ad9b86d 100644 --- a/packages/google-cloud-mediatranslation/.eslintignore +++ b/packages/google-cloud-mediatranslation/.eslintignore @@ -1,5 +1,6 @@ **/node_modules -src/**/doc/* +**/coverage +test/fixtures build/ docs/ protos/ diff --git a/packages/google-cloud-mediatranslation/.prettierignore b/packages/google-cloud-mediatranslation/.prettierignore index f6fac98b0a8..9340ad9b86d 100644 --- a/packages/google-cloud-mediatranslation/.prettierignore +++ b/packages/google-cloud-mediatranslation/.prettierignore @@ -1,3 +1,6 @@ -node_modules/* -samples/node_modules/* -src/**/doc/* +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ From 27c9af3acea1e2b40759f084e8f2c29d1b1fc946 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 19:29:39 -0700 Subject: [PATCH 016/147] chore: remove tslint.json (#29) --- packages/google-cloud-mediatranslation/tslint.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 packages/google-cloud-mediatranslation/tslint.json diff --git a/packages/google-cloud-mediatranslation/tslint.json b/packages/google-cloud-mediatranslation/tslint.json deleted file mode 100644 index 617dc975bae..00000000000 --- a/packages/google-cloud-mediatranslation/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "gts/tslint.json" -} From 5bca8f259397d515c17c9593ecad223740482e7f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 14 Apr 2020 09:54:40 -0700 Subject: [PATCH 017/147] chore: remove unused dev packages (#31) --- packages/google-cloud-mediatranslation/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 543e2f90dd3..1ac8c06932a 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -41,7 +41,6 @@ "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", - "prettier": "^1.19.1", "sinon": "^9.0.1", "ts-loader": "^6.2.1", "typescript": "^3.8.3", From 4ed239ed1b317059cefc656ee37340a45835c658 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 17:30:59 +0200 Subject: [PATCH 018/147] chore(deps): update dependency ts-loader to v7 (#32) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^6.2.1` -> `^7.0.0`](https://renovatebot.com/diffs/npm/ts-loader/6.2.2/7.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v7.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v700) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v6.2.2...v7.0.0) - [Project reference support enhancements](https://togithub.com/TypeStrong/ts-loader/pull/1076) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - Following the end of life of Node 8, `ts-loader` no longer supports Node 8 **BREAKING CHANGE**
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 1ac8c06932a..e25a3aa371e 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -42,7 +42,7 @@ "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^6.2.1", + "ts-loader": "^7.0.0", "typescript": "^3.8.3", "webpack": "^4.42.0", "webpack-cli": "^3.3.11" From 6f4f0d82513b1710b0aa502d118d613d3e7c1e5b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 18:30:38 +0200 Subject: [PATCH 019/147] chore(deps): update dependency null-loader to v4 (#34) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [null-loader](https://togithub.com/webpack-contrib/null-loader) | devDependencies | major | [`^3.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/null-loader/3.0.0/4.0.0) | --- ### Release Notes
webpack-contrib/null-loader ### [`v4.0.0`](https://togithub.com/webpack-contrib/null-loader/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpack-contribnull-loadercomparev300v400-2020-04-15) [Compare Source](https://togithub.com/webpack-contrib/null-loader/compare/v3.0.0...v4.0.0) ##### Bug Fixes - support `webpack@5` ##### ⚠ BREAKING CHANGES - minimum required Nodejs version is `10.13`
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index e25a3aa371e..04ecad575d3 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -39,7 +39,7 @@ "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.3", "mocha": "^7.0.0", - "null-loader": "^3.0.0", + "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", "ts-loader": "^7.0.0", From 324a49696820cb719e70a670c078aa36a027ccf3 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 15 Apr 2020 10:31:09 -0700 Subject: [PATCH 020/147] chore: run fix instead of lint in synthfile (#35) --- packages/google-cloud-mediatranslation/synth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/synth.py b/packages/google-cloud-mediatranslation/synth.py index e8206509c1f..9f2d1ca6172 100644 --- a/packages/google-cloud-mediatranslation/synth.py +++ b/packages/google-cloud-mediatranslation/synth.py @@ -46,5 +46,5 @@ # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'lint']) +subprocess.run(['npm', 'run', 'fix']) subprocess.run(['npx', 'compileProtos', 'src']) From a4ef6e869cc2a1cd71c1a386f4ca642e3cc874e9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 20 Apr 2020 16:03:28 -0700 Subject: [PATCH 021/147] chore: linting --- .../src/index.ts | 2 +- .../speech_translation_service_client.ts | 123 +++---- .../synth.metadata | 14 +- .../system-test/fixtures/sample/src/index.js | 1 + .../system-test/install.ts | 28 +- ...apic_speech_translation_service_v1beta1.ts | 345 +++++++----------- .../webpack.config.js | 12 +- 7 files changed, 222 insertions(+), 303 deletions(-) diff --git a/packages/google-cloud-mediatranslation/src/index.ts b/packages/google-cloud-mediatranslation/src/index.ts index c2bc720e777..67d12bdfea9 100644 --- a/packages/google-cloud-mediatranslation/src/index.ts +++ b/packages/google-cloud-mediatranslation/src/index.ts @@ -21,4 +21,4 @@ const SpeechTranslationServiceClient = v1beta1.SpeechTranslationServiceClient; export {v1beta1, SpeechTranslationServiceClient}; export default {v1beta1, SpeechTranslationServiceClient}; import * as protos from '../protos/protos'; -export {protos}; +export {protos} diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 97f5eb2d3fd..8045e9877bd 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -38,12 +38,7 @@ export class SpeechTranslationServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; + descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}, batching: {}}; innerApiCalls: {[name: string]: Function}; speechTranslationServiceStub?: Promise<{[name: string]: Function}>; @@ -75,14 +70,11 @@ export class SpeechTranslationServiceClient { constructor(opts?: ClientOptions) { // Ensure that options include the service address and port. - const staticMembers = this - .constructor as typeof SpeechTranslationServiceClient; - const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; + const staticMembers = this.constructor as typeof SpeechTranslationServiceClient; + const servicePath = opts && opts.servicePath ? + opts.servicePath : + ((opts && opts.apiEndpoint) ? opts.apiEndpoint : + staticMembers.servicePath); const port = opts && opts.port ? opts.port : staticMembers.port; if (!opts) { @@ -92,8 +84,8 @@ export class SpeechTranslationServiceClient { opts.port = opts.port || port; opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { + const isBrowser = (typeof window !== 'undefined'); + if (isBrowser){ opts.fallback = true; } // If we are in browser, we are already using fallback because of the @@ -103,18 +95,20 @@ export class SpeechTranslationServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. - opts.scopes = (this - .constructor as typeof SpeechTranslationServiceClient).scopes; + opts.scopes = (this.constructor as typeof SpeechTranslationServiceClient).scopes; this._gaxGrpc = new this._gaxModule.GrpcClient(opts); // Save options to use in initialize() method. this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); // Determine the client header string. - const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -130,35 +124,24 @@ export class SpeechTranslationServiceClient { // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); + const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath + opts.fallback ? + // eslint-disable-next-line @typescript-eslint/no-var-requires + require("../../protos/protos.json") : + nodejsProtoPath ); // Some of the methods on this service provide streaming responses. // Provide descriptors for these. this.descriptors.stream = { - streamingTranslateSpeech: new this._gaxModule.StreamDescriptor( - gax.StreamType.BIDI_STREAMING - ), + streamingTranslateSpeech: new this._gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING) }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.mediatranslation.v1beta1.SpeechTranslationService', - gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, - {'x-goog-api-client': clientHeader.join(' ')} - ); + 'google.cloud.mediatranslation.v1beta1.SpeechTranslationService', 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 @@ -186,19 +169,16 @@ export class SpeechTranslationServiceClient { // Put together the "service stub" for // google.cloud.mediatranslation.v1beta1.SpeechTranslationService. this.speechTranslationServiceStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.cloud.mediatranslation.v1beta1.SpeechTranslationService' - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.mediatranslation.v1beta1 - .SpeechTranslationService, - this._opts - ) as Promise<{[method: string]: Function}>; + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.mediatranslation.v1beta1.SpeechTranslationService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.mediatranslation.v1beta1.SpeechTranslationService, + 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 speechTranslationServiceStubMethods = ['streamingTranslateSpeech']; + const speechTranslationServiceStubMethods = + ['streamingTranslateSpeech']; for (const methodName of speechTranslationServiceStubMethods) { const callPromise = this.speechTranslationServiceStub.then( stub => (...args: Array<{}>) => { @@ -208,17 +188,16 @@ export class SpeechTranslationServiceClient { const func = stub[methodName]; return func.apply(stub, args); }, - (err: Error | null | undefined) => () => { + (err: Error|null|undefined) => () => { throw err; - } - ); + }); const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); this.innerApiCalls[methodName] = apiCall; @@ -254,7 +233,9 @@ export class SpeechTranslationServiceClient { * in this service. */ static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; } getProjectId(): Promise; @@ -264,9 +245,8 @@ export class SpeechTranslationServiceClient { * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId( - callback?: Callback - ): Promise | void { + getProjectId(callback?: Callback): + Promise|void { if (callback) { this.auth.getProjectId(callback); return; @@ -278,22 +258,25 @@ export class SpeechTranslationServiceClient { // -- Service calls -- // ------------------- - /** - * Performs bidirectional streaming speech translation: receive results while - * sending audio. This method is only available via the gRPC API (not REST). - * - * @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 is both readable and writable. It accepts objects - * representing [StreamingTranslateSpeechRequest]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest} for write() method, and - * will emit objects representing [StreamingTranslateSpeechResponse]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} on 'data' event asynchronously. - */ - streamingTranslateSpeech(options?: gax.CallOptions): gax.CancellableStream { +/** + * Performs bidirectional streaming speech translation: receive results while + * sending audio. This method is only available via the gRPC API (not REST). + * + * @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 is both readable and writable. It accepts objects + * representing [StreamingTranslateSpeechRequest]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest} for write() method, and + * will emit objects representing [StreamingTranslateSpeechResponse]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} on 'data' event asynchronously. + */ + streamingTranslateSpeech( + options?: gax.CallOptions): + gax.CancellableStream { this.initialize(); return this.innerApiCalls.streamingTranslateSpeech(options); } + /** * Terminate the GRPC channel and close the client. * diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 09bf536d91a..c82df2294ef 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -1,19 +1,25 @@ { - "updateTime": "2020-04-11T01:36:16.535216Z", "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-media-translation.git", + "sha": "901ed15f49ae7dfc047d95a44f1b65a7be0dc934" + } + }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1bd77e8ce6f953ac641af7966d0c52646afc16a8", - "internalRef": "305974465" + "sha": "3028060618e8024af9a32b3ab3456c160091ecb7", + "internalRef": "306450502" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5" + "sha": "52638600f387deb98efb5f9c85fec39e82aa9052" } } ], diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js index 69241f359d5..4bdd1de43c9 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** + /* eslint-disable node/no-missing-require, no-unused-vars */ const mediatranslation = require('@google-cloud/media-translation'); diff --git a/packages/google-cloud-mediatranslation/system-test/install.ts b/packages/google-cloud-mediatranslation/system-test/install.ts index c4d80e9c0c8..5e4ed636481 100644 --- a/packages/google-cloud-mediatranslation/system-test/install.ts +++ b/packages/google-cloud-mediatranslation/system-test/install.ts @@ -16,36 +16,34 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; describe('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), // path to your module. sample: { description: 'typescript based user can use the type definitions', - ts: readFileSync( - './system-test/fixtures/sample/src/index.ts' - ).toString(), - }, + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } }; - await packNTest(options); // will throw upon error. + await packNTest(options); // will throw upon error. }); it('should have correct type signature for javascript users', async function() { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), // path to your module. sample: { description: 'typescript based user can use the type definitions', - ts: readFileSync( - './system-test/fixtures/sample/src/index.js' - ).toString(), - }, + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } }; - await packNTest(options); // will throw upon error. + await packNTest(options); // will throw upon error. }); + }); diff --git a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts index 16437edcb1c..89c6a90fb44 100644 --- a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts +++ b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts @@ -20,7 +20,7 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import { describe, it } from 'mocha'; import * as speechtranslationserviceModule from '../src'; import {PassThrough} from 'stream'; @@ -28,221 +28,152 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); - return (instance.constructor as typeof protobuf.Message).fromObject( - filledObject - ) as T; + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; } -function stubBidiStreamingCall( - response?: ResponseType, - error?: Error -) { - const transformStub = error - ? sinon.stub().callsArgWith(2, error) - : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - return sinon.stub().returns(mockStream); +function stubBidiStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); } describe('v1beta1.SpeechTranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient - .servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = - speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient - .port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - fallback: true, - } - ); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.speechTranslationServiceStub, undefined); - await client.initialize(); - assert(client.speechTranslationServiceStub); - }); - - it('has close method', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.close(); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - 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 speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - 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 servicePath', () => { + const servicePath = speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ + fallback: true, + }); + assert(client); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('streamingTranslateSpeech', () => { - it('invokes streamingTranslateSpeech without error', async () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse() - ); - client.innerApiCalls.streamingTranslateSpeech = stubBidiStreamingCall( - expectedResponse - ); - const stream = client.streamingTranslateSpeech(); - const promise = new Promise((resolve, reject) => { - stream.on( - 'data', - ( - response: protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse - ) => { - resolve(response); - } - ); - stream.on('error', (err: Error) => { - reject(err); + + it('has initialize method and supports deferred initialization', async () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', }); - stream.write(request); - stream.end(); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.streamingTranslateSpeech as SinonStub) - .getCall(0) - .calledWithExactly(undefined) - ); - assert.deepStrictEqual( - (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( - 0 - ).args[0], - request - ); + assert.strictEqual(client.speechTranslationServiceStub, undefined); + await client.initialize(); + assert(client.speechTranslationServiceStub); }); - it('invokes streamingTranslateSpeech with error', async () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.streamingTranslateSpeech = stubBidiStreamingCall( - undefined, - expectedError - ); - const stream = client.streamingTranslateSpeech(); - const promise = new Promise((resolve, reject) => { - stream.on( - 'data', - ( - response: protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse - ) => { - resolve(response); - } - ); - stream.on('error', (err: Error) => { - reject(err); + it('has close method', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ + 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 speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ + 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('streamingTranslateSpeech', () => { + it('invokes streamingTranslateSpeech without error', async () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest()); + const expectedResponse = generateSampleMessage(new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse()); + client.innerApiCalls.streamingTranslateSpeech = stubBidiStreamingCall(expectedResponse); + const stream = client.streamingTranslateSpeech(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.streamingTranslateSpeech as SinonStub) + .getCall(0).calledWithExactly(undefined)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + + it('invokes streamingTranslateSpeech with error', async () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest());const expectedError = new Error('expected'); + client.innerApiCalls.streamingTranslateSpeech = stubBidiStreamingCall(undefined, expectedError); + const stream = client.streamingTranslateSpeech(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(async () => { await promise; }, expectedError); + assert((client.innerApiCalls.streamingTranslateSpeech as SinonStub) + .getCall(0).calledWithExactly(undefined)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); }); - stream.write(request); - stream.end(); - }); - await assert.rejects(async () => { - await promise; - }, expectedError); - assert( - (client.innerApiCalls.streamingTranslateSpeech as SinonStub) - .getCall(0) - .calledWithExactly(undefined) - ); - assert.deepStrictEqual( - (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( - 0 - ).args[0], - request - ); }); - }); }); diff --git a/packages/google-cloud-mediatranslation/webpack.config.js b/packages/google-cloud-mediatranslation/webpack.config.js index 4d45979f371..f1a3ef3de23 100644 --- a/packages/google-cloud-mediatranslation/webpack.config.js +++ b/packages/google-cloud-mediatranslation/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/, + exclude: /node_modules/ }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]grpc/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader', + use: 'null-loader' }, ], }, From f39498a091c50951541ee8403de7169c5ec05018 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 21 Apr 2020 20:27:34 -0700 Subject: [PATCH 022/147] build: adopt changes to generator formatting (#37) --- .../protos/protos.js | 234 ++++++------ .../src/index.ts | 2 +- .../speech_translation_service_client.ts | 123 ++++--- .../synth.metadata | 8 +- .../system-test/fixtures/sample/src/index.js | 1 - .../system-test/install.ts | 32 +- ...apic_speech_translation_service_v1beta1.ts | 345 +++++++++++------- .../webpack.config.js | 12 +- 8 files changed, 422 insertions(+), 335 deletions(-) diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index 8fb32049b06..e8e5a730c04 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -236,15 +236,15 @@ TranslateSpeechConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.audioEncoding); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCode); - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.sampleRateHertz); - if (message.model != null && message.hasOwnProperty("model")) + if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.model); if (message.alternativeSourceLanguageCodes != null && message.alternativeSourceLanguageCodes.length) for (var i = 0; i < message.alternativeSourceLanguageCodes.length; ++i) @@ -514,9 +514,9 @@ StreamingTranslateSpeechConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) + if (message.audioConfig != null && Object.hasOwnProperty.call(message, "audioConfig")) $root.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.encode(message.audioConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.singleUtterance); return writer; }; @@ -743,9 +743,9 @@ StreamingTranslateSpeechRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) + if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig")) $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.encode(message.streamingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.audioContent != null && message.hasOwnProperty("audioContent")) + if (message.audioContent != null && Object.hasOwnProperty.call(message, "audioContent")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent); return writer; }; @@ -985,9 +985,9 @@ StreamingTranslateSpeechResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.textTranslationResult != null && message.hasOwnProperty("textTranslationResult")) + if (message.textTranslationResult != null && Object.hasOwnProperty.call(message, "textTranslationResult")) $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.encode(message.textTranslationResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) + if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.recognitionResult); return writer; }; @@ -1211,11 +1211,11 @@ TextTranslationResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.translation != null && message.hasOwnProperty("translation")) + if (message.translation != null && Object.hasOwnProperty.call(message, "translation")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.translation); - if (message.isFinal != null && message.hasOwnProperty("isFinal")) + if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isFinal); - if (message.detectedSourceLanguageCode != null && message.hasOwnProperty("detectedSourceLanguageCode")) + if (message.detectedSourceLanguageCode != null && Object.hasOwnProperty.call(message, "detectedSourceLanguageCode")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.detectedSourceLanguageCode); return writer; }; @@ -1446,11 +1446,11 @@ StreamingTranslateSpeechResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.error != null && message.hasOwnProperty("error")) + if (message.error != null && Object.hasOwnProperty.call(message, "error")) $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.result != null && message.hasOwnProperty("result")) + if (message.result != null && Object.hasOwnProperty.call(message, "result")) $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.encode(message.result, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) + if (message.speechEventType != null && Object.hasOwnProperty.call(message, "speechEventType")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.speechEventType); return writer; }; @@ -1627,7 +1627,7 @@ /** * SpeechEventType enum. * @name google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType - * @enum {string} + * @enum {number} * @property {number} SPEECH_EVENT_TYPE_UNSPECIFIED=0 SPEECH_EVENT_TYPE_UNSPECIFIED value * @property {number} END_OF_SINGLE_UTTERANCE=1 END_OF_SINGLE_UTTERANCE value */ @@ -1662,7 +1662,7 @@ /** * FieldBehavior enum. * @name google.api.FieldBehavior - * @enum {string} + * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value @@ -2063,9 +2063,9 @@ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("package")) + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); if (message.dependency != null && message.dependency.length) for (var i = 0; i < message.dependency.length; ++i) @@ -2082,9 +2082,9 @@ if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.publicDependency != null && message.publicDependency.length) for (var i = 0; i < message.publicDependency.length; ++i) @@ -2092,7 +2092,7 @@ if (message.weakDependency != null && message.weakDependency.length) for (var i = 0; i < message.weakDependency.length; ++i) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && message.hasOwnProperty("syntax")) + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -2630,7 +2630,7 @@ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.field != null && message.field.length) for (var i = 0; i < message.field.length; ++i) @@ -2647,7 +2647,7 @@ if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.oneofDecl != null && message.oneofDecl.length) for (var i = 0; i < message.oneofDecl.length; ++i) @@ -3112,11 +3112,11 @@ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -3340,9 +3340,9 @@ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -3833,25 +3833,25 @@ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) + if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; @@ -4198,7 +4198,7 @@ /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} + * @enum {number} * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value * @property {number} TYPE_INT64=3 TYPE_INT64 value @@ -4244,7 +4244,7 @@ /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} + * @enum {number} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value @@ -4325,9 +4325,9 @@ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -4570,12 +4570,12 @@ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.value != null && message.value.length) for (var i = 0; i < message.value.length; ++i) $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) @@ -4878,9 +4878,9 @@ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -5100,11 +5100,11 @@ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -5338,12 +5338,12 @@ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.method != null && message.method.length) for (var i = 0; i < message.method.length; ++i) $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -5623,17 +5623,17 @@ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -6062,45 +6062,45 @@ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -6493,7 +6493,7 @@ /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} + * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value @@ -6602,13 +6602,13 @@ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -6928,17 +6928,17 @@ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("weak")) + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -7267,7 +7267,7 @@ /** * CType enum. * @name google.protobuf.FieldOptions.CType - * @enum {string} + * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value @@ -7283,7 +7283,7 @@ /** * JSType enum. * @name google.protobuf.FieldOptions.JSType - * @enum {string} + * @enum {number} * @property {number} JS_NORMAL=0 JS_NORMAL value * @property {number} JS_STRING=1 JS_STRING value * @property {number} JS_NUMBER=2 JS_NUMBER value @@ -7582,9 +7582,9 @@ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -7827,7 +7827,7 @@ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -8076,14 +8076,14 @@ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; @@ -8353,9 +8353,9 @@ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -8579,7 +8579,7 @@ /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {string} + * @enum {number} * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value * @property {number} IDEMPOTENT=2 IDEMPOTENT value @@ -8709,17 +8709,17 @@ if (message.name != null && message.name.length) for (var i = 0; i < message.name.length; ++i) $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -9496,9 +9496,9 @@ writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) for (var i = 0; i < message.leadingDetachedComments.length; ++i) @@ -10029,11 +10029,11 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -10286,9 +10286,9 @@ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && message.hasOwnProperty("type_url")) + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; @@ -10527,9 +10527,9 @@ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); if (message.details != null && message.details.length) for (var i = 0; i < message.details.length; ++i) diff --git a/packages/google-cloud-mediatranslation/src/index.ts b/packages/google-cloud-mediatranslation/src/index.ts index 67d12bdfea9..c2bc720e777 100644 --- a/packages/google-cloud-mediatranslation/src/index.ts +++ b/packages/google-cloud-mediatranslation/src/index.ts @@ -21,4 +21,4 @@ const SpeechTranslationServiceClient = v1beta1.SpeechTranslationServiceClient; export {v1beta1, SpeechTranslationServiceClient}; export default {v1beta1, SpeechTranslationServiceClient}; import * as protos from '../protos/protos'; -export {protos} +export {protos}; diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 8045e9877bd..97f5eb2d3fd 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -38,7 +38,12 @@ export class SpeechTranslationServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; - descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}, batching: {}}; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; innerApiCalls: {[name: string]: Function}; speechTranslationServiceStub?: Promise<{[name: string]: Function}>; @@ -70,11 +75,14 @@ export class SpeechTranslationServiceClient { constructor(opts?: ClientOptions) { // Ensure that options include the service address and port. - const staticMembers = this.constructor as typeof SpeechTranslationServiceClient; - const servicePath = opts && opts.servicePath ? - opts.servicePath : - ((opts && opts.apiEndpoint) ? opts.apiEndpoint : - staticMembers.servicePath); + const staticMembers = this + .constructor as typeof SpeechTranslationServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; const port = opts && opts.port ? opts.port : staticMembers.port; if (!opts) { @@ -84,8 +92,8 @@ export class SpeechTranslationServiceClient { opts.port = opts.port || port; opts.clientConfig = opts.clientConfig || {}; - const isBrowser = (typeof window !== 'undefined'); - if (isBrowser){ + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { opts.fallback = true; } // If we are in browser, we are already using fallback because of the @@ -95,20 +103,18 @@ export class SpeechTranslationServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. - opts.scopes = (this.constructor as typeof SpeechTranslationServiceClient).scopes; + opts.scopes = (this + .constructor as typeof SpeechTranslationServiceClient).scopes; this._gaxGrpc = new this._gaxModule.GrpcClient(opts); // Save options to use in initialize() method. this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -124,24 +130,35 @@ export class SpeechTranslationServiceClient { // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. - const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? - // eslint-disable-next-line @typescript-eslint/no-var-requires - require("../../protos/protos.json") : - nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // Some of the methods on this service provide streaming responses. // Provide descriptors for these. this.descriptors.stream = { - streamingTranslateSpeech: new this._gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING) + streamingTranslateSpeech: new this._gaxModule.StreamDescriptor( + gax.StreamType.BIDI_STREAMING + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.mediatranslation.v1beta1.SpeechTranslationService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.mediatranslation.v1beta1.SpeechTranslationService', + 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 @@ -169,16 +186,19 @@ export class SpeechTranslationServiceClient { // Put together the "service stub" for // google.cloud.mediatranslation.v1beta1.SpeechTranslationService. this.speechTranslationServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.mediatranslation.v1beta1.SpeechTranslationService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.mediatranslation.v1beta1.SpeechTranslationService, - this._opts) as Promise<{[method: string]: Function}>; + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.mediatranslation.v1beta1.SpeechTranslationService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.mediatranslation.v1beta1 + .SpeechTranslationService, + 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 speechTranslationServiceStubMethods = - ['streamingTranslateSpeech']; + const speechTranslationServiceStubMethods = ['streamingTranslateSpeech']; for (const methodName of speechTranslationServiceStubMethods) { const callPromise = this.speechTranslationServiceStub.then( stub => (...args: Array<{}>) => { @@ -188,16 +208,17 @@ export class SpeechTranslationServiceClient { const func = stub[methodName]; return func.apply(stub, args); }, - (err: Error|null|undefined) => () => { + (err: Error | null | undefined) => () => { throw err; - }); + } + ); const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); this.innerApiCalls[methodName] = apiCall; @@ -233,9 +254,7 @@ export class SpeechTranslationServiceClient { * in this service. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(): Promise; @@ -245,8 +264,9 @@ export class SpeechTranslationServiceClient { * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId(callback?: Callback): - Promise|void { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -258,25 +278,22 @@ export class SpeechTranslationServiceClient { // -- Service calls -- // ------------------- -/** - * Performs bidirectional streaming speech translation: receive results while - * sending audio. This method is only available via the gRPC API (not REST). - * - * @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 is both readable and writable. It accepts objects - * representing [StreamingTranslateSpeechRequest]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest} for write() method, and - * will emit objects representing [StreamingTranslateSpeechResponse]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} on 'data' event asynchronously. - */ - streamingTranslateSpeech( - options?: gax.CallOptions): - gax.CancellableStream { + /** + * Performs bidirectional streaming speech translation: receive results while + * sending audio. This method is only available via the gRPC API (not REST). + * + * @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 is both readable and writable. It accepts objects + * representing [StreamingTranslateSpeechRequest]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest} for write() method, and + * will emit objects representing [StreamingTranslateSpeechResponse]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} on 'data' event asynchronously. + */ + streamingTranslateSpeech(options?: gax.CallOptions): gax.CancellableStream { this.initialize(); return this.innerApiCalls.streamingTranslateSpeech(options); } - /** * Terminate the GRPC channel and close the client. * diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index c82df2294ef..5637e2d9999 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "901ed15f49ae7dfc047d95a44f1b65a7be0dc934" + "sha": "3afe642f6e6955b49c188e66f29115a5deb8c0f6" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3028060618e8024af9a32b3ab3456c160091ecb7", - "internalRef": "306450502" + "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", + "internalRef": "307114445" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "52638600f387deb98efb5f9c85fec39e82aa9052" + "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" } } ], diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js index 4bdd1de43c9..69241f359d5 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js @@ -16,7 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** - /* eslint-disable node/no-missing-require, no-unused-vars */ const mediatranslation = require('@google-cloud/media-translation'); diff --git a/packages/google-cloud-mediatranslation/system-test/install.ts b/packages/google-cloud-mediatranslation/system-test/install.ts index 5e4ed636481..4c1ba3eb79a 100644 --- a/packages/google-cloud-mediatranslation/system-test/install.ts +++ b/packages/google-cloud-mediatranslation/system-test/install.ts @@ -16,34 +16,36 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import { packNTest } from 'pack-n-play'; -import { readFileSync } from 'fs'; -import { describe, it } from 'mocha'; +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; describe('typescript consumer tests', () => { - - it('should have correct type signature for typescript users', async function() { + it('should have correct type signature for typescript users', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), // path to your module. sample: { description: 'typescript based user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); // will throw upon error. }); - it('should have correct type signature for javascript users', async function() { + it('should have correct type signature for javascript users', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), // path to your module. sample: { description: 'typescript based user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); // will throw upon error. }); - }); diff --git a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts index 89c6a90fb44..16437edcb1c 100644 --- a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts +++ b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts @@ -20,7 +20,7 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; +import {describe, it} from 'mocha'; import * as speechtranslationserviceModule from '../src'; import {PassThrough} from 'stream'; @@ -28,152 +28,221 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; } -function stubBidiStreamingCall(response?: ResponseType, error?: Error) { - const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - return sinon.stub().returns(mockStream); +function stubBidiStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); } describe('v1beta1.SpeechTranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ - fallback: true, - }); - assert(client); + it('has servicePath', () => { + const servicePath = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.speechTranslationServiceStub, undefined); + await client.initialize(); + assert(client.speechTranslationServiceStub); + }); + + it('has close method', () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + 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 speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + 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 initialize method and supports deferred initialization', async () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('streamingTranslateSpeech', () => { + it('invokes streamingTranslateSpeech without error', async () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse() + ); + client.innerApiCalls.streamingTranslateSpeech = stubBidiStreamingCall( + expectedResponse + ); + const stream = client.streamingTranslateSpeech(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); }); - assert.strictEqual(client.speechTranslationServiceStub, undefined); - await client.initialize(); - assert(client.speechTranslationServiceStub); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.streamingTranslateSpeech as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( + 0 + ).args[0], + request + ); }); - it('has close method', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.close(); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ - 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 speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ - 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('streamingTranslateSpeech', () => { - it('invokes streamingTranslateSpeech without error', async () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest()); - const expectedResponse = generateSampleMessage(new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse()); - client.innerApiCalls.streamingTranslateSpeech = stubBidiStreamingCall(expectedResponse); - const stream = client.streamingTranslateSpeech(); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - stream.write(request); - stream.end(); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.streamingTranslateSpeech as SinonStub) - .getCall(0).calledWithExactly(undefined)); - assert.deepStrictEqual(((stream as unknown as PassThrough) - ._transform as SinonStub).getCall(0).args[0], request); - }); - - it('invokes streamingTranslateSpeech with error', async () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest());const expectedError = new Error('expected'); - client.innerApiCalls.streamingTranslateSpeech = stubBidiStreamingCall(undefined, expectedError); - const stream = client.streamingTranslateSpeech(); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - stream.write(request); - stream.end(); - }); - await assert.rejects(async () => { await promise; }, expectedError); - assert((client.innerApiCalls.streamingTranslateSpeech as SinonStub) - .getCall(0).calledWithExactly(undefined)); - assert.deepStrictEqual(((stream as unknown as PassThrough) - ._transform as SinonStub).getCall(0).args[0], request); + it('invokes streamingTranslateSpeech with error', async () => { + const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingTranslateSpeech = stubBidiStreamingCall( + undefined, + expectedError + ); + const stream = client.streamingTranslateSpeech(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); }); + stream.write(request); + stream.end(); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.innerApiCalls.streamingTranslateSpeech as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( + 0 + ).args[0], + request + ); }); + }); }); diff --git a/packages/google-cloud-mediatranslation/webpack.config.js b/packages/google-cloud-mediatranslation/webpack.config.js index f1a3ef3de23..4d45979f371 100644 --- a/packages/google-cloud-mediatranslation/webpack.config.js +++ b/packages/google-cloud-mediatranslation/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]grpc/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader' + use: 'null-loader', }, ], }, From ac064836787bcc0ed7b79601bbb4312335aafb19 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:30:28 -0700 Subject: [PATCH 023/147] chore: update npm scripts and synth.py (#38) Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool. --- packages/google-cloud-mediatranslation/package.json | 5 +++-- packages/google-cloud-mediatranslation/synth.py | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 04ecad575d3..6473e9c8ecd 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -21,9 +21,10 @@ "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", "fix": "gts fix", - "lint": "gts fix", + "lint": "gts check", "prelint": "cd samples; npm link ../; npm install", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.1.0" diff --git a/packages/google-cloud-mediatranslation/synth.py b/packages/google-cloud-mediatranslation/synth.py index 9f2d1ca6172..f513737044c 100644 --- a/packages/google-cloud-mediatranslation/synth.py +++ b/packages/google-cloud-mediatranslation/synth.py @@ -15,7 +15,7 @@ import synthtool as s import synthtool.gcp as gcp -import subprocess +import synthtool.languages.node as node import logging logging.basicConfig(level=logging.DEBUG) @@ -44,7 +44,4 @@ templates = common_templates.node_library(source_location='build/src') s.copy(templates, excludes=['linkinator.config.json']) -# Node.js specific cleanup -subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) -subprocess.run(['npx', 'compileProtos', 'src']) +node.postprocess_gapic_library() From 8da36387f28636b009274075c05e32811515136e Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 5 May 2020 19:34:07 -0700 Subject: [PATCH 024/147] fix: regen protos and tests, formatting (#39) --- .../google-cloud-mediatranslation/synth.metadata | 14 +++----------- .../gapic_speech_translation_service_v1beta1.ts | 4 +--- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 5637e2d9999..a88bc9f0573 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "3afe642f6e6955b49c188e66f29115a5deb8c0f6" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", - "internalRef": "307114445" + "remote": "git@github.com:googleapis/nodejs-media-translation.git", + "sha": "ef9997e4e1bda7d8bec097a2db56f67b67068730" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" + "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" } } ], diff --git a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts index 16437edcb1c..7f97daaa044 100644 --- a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts +++ b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts @@ -229,9 +229,7 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { stream.write(request); stream.end(); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.innerApiCalls.streamingTranslateSpeech as SinonStub) .getCall(0) From 7024ce2bc2376d2e182a1d5025e8e68fed7f330a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 May 2020 11:34:16 -0700 Subject: [PATCH 025/147] build: do not fail builds on codecov errors (#528) (#40) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/2f68300a-9812-4342-86c6-33ab267ece4f/targets Source-Link: https://github.com/googleapis/synthtool/commit/be74d3e532faa47eb59f1a0eaebde0860d1d8ab4 --- .../google-cloud-mediatranslation/synth.metadata | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index a88bc9f0573..fc0f417f662 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -3,15 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-media-translation.git", - "sha": "ef9997e4e1bda7d8bec097a2db56f67b67068730" + "remote": "https://github.com/googleapis/nodejs-media-translation.git", + "sha": "684f355cbecec36c18763b59ddec613c0ea097a9" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "83816bb3093686a28af2891db5b7506614a820b1", + "internalRef": "310509915" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" + "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" } } ], From 638b51d520822e2cfd368564aca91c85a749db50 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Wed, 27 May 2020 15:34:03 -0700 Subject: [PATCH 026/147] fix: streaming mic sample --- packages/google-cloud-mediatranslation/.repo-metadata.json | 2 +- packages/google-cloud-mediatranslation/README.md | 2 +- packages/google-cloud-mediatranslation/linkinator.config.json | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.repo-metadata.json b/packages/google-cloud-mediatranslation/.repo-metadata.json index 26498f3761d..abd57bbd313 100644 --- a/packages/google-cloud-mediatranslation/.repo-metadata.json +++ b/packages/google-cloud-mediatranslation/.repo-metadata.json @@ -1,7 +1,7 @@ { "name": "mediatranslation", "name_pretty": "Cloud Media Translation", - "product_documentation": "https://cloud.google.com/mediatranslation/docs/", + "product_documentation": "https://cloud.google.com/translate/media/docs/", "client_documentation": "https://googleapis.dev/nodejs/mediatranslation/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/559749", "release_level": "beta", diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index e7f19289e5c..677726c874a 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -203,7 +203,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-media-translation/blob/master/LICENSE) [client-docs]: https://googleapis.dev/nodejs/mediatranslation/latest -[product-docs]: https://cloud.google.com/mediatranslation/docs/ +[product-docs]: https://cloud.google.com/translate/media/docs/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing diff --git a/packages/google-cloud-mediatranslation/linkinator.config.json b/packages/google-cloud-mediatranslation/linkinator.config.json index 06a195b13fe..29a223b6db6 100644 --- a/packages/google-cloud-mediatranslation/linkinator.config.json +++ b/packages/google-cloud-mediatranslation/linkinator.config.json @@ -3,8 +3,7 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io", - "https://cloud.google.com/mediatranslation/docs" + "img.shields.io" ], "silent": true, "concurrency": 10 From 344b1fd5301ddfb5f2637e63b9984531e77dc838 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Jun 2020 17:35:54 -0700 Subject: [PATCH 027/147] docs: update product doc links --- packages/google-cloud-mediatranslation/samples/README.md | 2 +- packages/google-cloud-mediatranslation/synth.metadata | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/samples/README.md b/packages/google-cloud-mediatranslation/samples/README.md index b43a37315fc..2d998a2e11d 100644 --- a/packages/google-cloud-mediatranslation/samples/README.md +++ b/packages/google-cloud-mediatranslation/samples/README.md @@ -83,4 +83,4 @@ __Usage:__ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/README.md -[product-docs]: https://cloud.google.com/mediatranslation/docs/ +[product-docs]: https://cloud.google.com/translate/media/docs/ diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index fc0f417f662..ff8fa6b6f9a 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "684f355cbecec36c18763b59ddec613c0ea097a9" + "sha": "488c23522b31e26b419c9a4cb5829969e9050928" } }, { From 4c886a9c431e6a8f36e25f9b1c487e2b63fd4597 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 4 Jun 2020 12:29:50 -0700 Subject: [PATCH 028/147] chore: add proto3Optional field (#43) --- .../protos/protos.d.ts | 6 +++++ .../protos/protos.js | 26 +++++++++++++++++-- .../protos/protos.json | 6 ++++- .../synth.metadata | 2 +- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts index a3a1f742052..32347bb72ba 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.d.ts +++ b/packages/google-cloud-mediatranslation/protos/protos.d.ts @@ -1434,6 +1434,9 @@ export namespace google { /** FieldDescriptorProto options */ options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); } /** Represents a FieldDescriptorProto. */ @@ -1475,6 +1478,9 @@ export namespace google { /** FieldDescriptorProto options. */ public options?: (google.protobuf.IFieldOptions|null); + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + /** * Creates a new FieldDescriptorProto instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index e8e5a730c04..677789de3fc 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -3712,6 +3712,7 @@ * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex * @property {string|null} [jsonName] FieldDescriptorProto jsonName * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional */ /** @@ -3809,6 +3810,14 @@ */ FieldDescriptorProto.prototype.options = null; + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + /** * Creates a new FieldDescriptorProto instance using the specified properties. * @function create @@ -3853,6 +3862,8 @@ writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); return writer; }; @@ -3917,6 +3928,9 @@ case 8: message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); break; + case 17: + message.proto3Optional = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -4011,6 +4025,9 @@ if (error) return "options." + error; } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; return null; }; @@ -4133,6 +4150,8 @@ throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); return message; }; @@ -4160,6 +4179,7 @@ object.options = null; object.oneofIndex = 0; object.jsonName = ""; + object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -4181,6 +4201,8 @@ object.oneofIndex = message.oneofIndex; if (message.jsonName != null && message.hasOwnProperty("jsonName")) object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; return object; }; @@ -5972,7 +5994,7 @@ * @memberof google.protobuf.FileOptions * @instance */ - FileOptions.prototype.ccEnableArenas = false; + FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. @@ -6421,7 +6443,7 @@ object.javaGenerateEqualsAndHash = false; object.deprecated = false; object.javaStringCheckUtf8 = false; - object.ccEnableArenas = false; + object.ccEnableArenas = true; object.objcClassPrefix = ""; object.csharpNamespace = ""; object.swiftPrefix = ""; diff --git a/packages/google-cloud-mediatranslation/protos/protos.json b/packages/google-cloud-mediatranslation/protos/protos.json index 6694c3b1aa3..afbceeb4d95 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.json +++ b/packages/google-cloud-mediatranslation/protos/protos.json @@ -471,6 +471,10 @@ "options": { "type": "FieldOptions", "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 } }, "nested": { @@ -706,7 +710,7 @@ "type": "bool", "id": 31, "options": { - "default": false + "default": true } }, "objcClassPrefix": { diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index ff8fa6b6f9a..8c735d16ee8 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "488c23522b31e26b419c9a4cb5829969e9050928" + "sha": "e4d512bde02942fb198aded19224c319b518d81a" } }, { From 0db9d036c2eb7da7cd807a84882756bf38ad4b00 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2020 19:38:13 +0000 Subject: [PATCH 029/147] chore: release 2.1.0 (#27) :robot: I have created a release \*beep\* \*boop\* --- ## [2.1.0](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.0.0...v2.1.0) (2020-06-04) ### Features * adds 'single_utterance' to stream from file sample ([#20](https://www.github.com/googleapis/nodejs-media-translation/issues/20)) ([9455e20](https://www.github.com/googleapis/nodejs-media-translation/commit/9455e207de7ff9c9f72936dd3a908b694eee59fe)) ### Bug Fixes * regen protos and tests, formatting ([#39](https://www.github.com/googleapis/nodejs-media-translation/issues/39)) ([684f355](https://www.github.com/googleapis/nodejs-media-translation/commit/684f355cbecec36c18763b59ddec613c0ea097a9)) * remove eslint, update gax, fix generated protos, run the generator ([#24](https://www.github.com/googleapis/nodejs-media-translation/issues/24)) ([3aca62a](https://www.github.com/googleapis/nodejs-media-translation/commit/3aca62aed3a4e49e4892f9ad29c3d0166c57fa56)) * streaming mic sample ([488c235](https://www.github.com/googleapis/nodejs-media-translation/commit/488c23522b31e26b419c9a4cb5829969e9050928)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- .../google-cloud-mediatranslation/CHANGELOG.md | 14 ++++++++++++++ .../google-cloud-mediatranslation/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index 527c829a23f..b07e17ab3ec 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [2.1.0](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.0.0...v2.1.0) (2020-06-04) + + +### Features + +* adds 'single_utterance' to stream from file sample ([#20](https://www.github.com/googleapis/nodejs-media-translation/issues/20)) ([9455e20](https://www.github.com/googleapis/nodejs-media-translation/commit/9455e207de7ff9c9f72936dd3a908b694eee59fe)) + + +### Bug Fixes + +* regen protos and tests, formatting ([#39](https://www.github.com/googleapis/nodejs-media-translation/issues/39)) ([684f355](https://www.github.com/googleapis/nodejs-media-translation/commit/684f355cbecec36c18763b59ddec613c0ea097a9)) +* remove eslint, update gax, fix generated protos, run the generator ([#24](https://www.github.com/googleapis/nodejs-media-translation/issues/24)) ([3aca62a](https://www.github.com/googleapis/nodejs-media-translation/commit/3aca62aed3a4e49e4892f9ad29c3d0166c57fa56)) +* streaming mic sample ([488c235](https://www.github.com/googleapis/nodejs-media-translation/commit/488c23522b31e26b419c9a4cb5829969e9050928)) + ## [2.0.0](https://www.github.com/googleapis/nodejs-media-translation/compare/v1.0.0...v2.0.0) (2020-04-05) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 6473e9c8ecd..a81b67fe853 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.0.0", + "version": "2.1.0", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 8d6089f04e0..420207c0bb9 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.0.0", + "@google-cloud/media-translation": "^2.1.0", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From acde5fca382a3b1791b52dddacbeca66c12b965f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 9 Jun 2020 17:40:06 -0700 Subject: [PATCH 030/147] feat: move ts target to es2018 from es2016 (#46) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9b55eba7-85ee-48d5-a737-8b677439db4d/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/1c92077459db3dc50741e878f98b08c6261181e0 --- packages/google-cloud-mediatranslation/protos/protos.js | 2 +- .../src/v1beta1/speech_translation_service_client.ts | 7 +++++++ packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- packages/google-cloud-mediatranslation/tsconfig.json | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index 677789de3fc..54141277f59 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_media_translation_2_0_0_protos || ($protobuf.roots._google_cloud_media_translation_2_0_0_protos = {}); + var $root = $protobuf.roots._google_cloud_media_translation_protos || ($protobuf.roots._google_cloud_media_translation_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 97f5eb2d3fd..66eff03ed1e 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -90,6 +90,13 @@ export class SpeechTranslationServiceClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 8c735d16ee8..efbcff1372b 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "e4d512bde02942fb198aded19224c319b518d81a" + "sha": "6c52ff11511648eaa1fb10f647c9e369dea57cf9" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" + "sha": "1c92077459db3dc50741e878f98b08c6261181e0" } } ], diff --git a/packages/google-cloud-mediatranslation/tsconfig.json b/packages/google-cloud-mediatranslation/tsconfig.json index 613d35597b5..c78f1c884ef 100644 --- a/packages/google-cloud-mediatranslation/tsconfig.json +++ b/packages/google-cloud-mediatranslation/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "build", "resolveJsonModule": true, "lib": [ - "es2016", + "es2018", "dom" ] }, From 1d27cc6b1b88a8f9101e44adb04baf7aa035174a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 11 Jun 2020 17:46:40 +0200 Subject: [PATCH 031/147] chore(deps): update dependency mocha to v8 (#49) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [mocha](https://mochajs.org/) ([source](https://togithub.com/mochajs/mocha)) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/mocha/7.2.0/8.0.1) | --- ### Release Notes
mochajs/mocha ### [`v8.0.1`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​801--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v8.0.0...v8.0.1) The obligatory patch after a major. #### :bug: Fixes - [#​4328](https://togithub.com/mochajs/mocha/issues/4328): Fix `--parallel` when combined with `--watch` ([**@​boneskull**](https://togithub.com/boneskull)) ### [`v8.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​800--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v7.2.0...v8.0.0) In this major release, Mocha adds the ability to _run tests in parallel_. Better late than never! Please note the **breaking changes** detailed below. Let's welcome [**@​giltayar**](https://togithub.com/giltayar) and [**@​nicojs**](https://togithub.com/nicojs) to the maintenance team! #### :boom: Breaking Changes - [#​4164](https://togithub.com/mochajs/mocha/issues/4164): **Mocha v8.0.0 now requires Node.js v10.0.0 or newer.** Mocha no longer supports the Node.js v8.x line ("Carbon"), which entered End-of-Life at the end of 2019 ([**@​UlisesGascon**](https://togithub.com/UlisesGascon)) - [#​4175](https://togithub.com/mochajs/mocha/issues/4175): Having been deprecated with a warning since v7.0.0, **`mocha.opts` is no longer supported** ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND:** Replace `mocha.opts` with a [configuration file](https://mochajs.org/#configuring-mocha-nodejs). - [#​4260](https://togithub.com/mochajs/mocha/issues/4260): Remove `enableTimeout()` (`this.enableTimeout()`) from the context object ([**@​craigtaub**](https://togithub.com/craigtaub)) :sparkles: **WORKAROUND:** Replace usage of `this.enableTimeout(false)` in your tests with `this.timeout(0)`. - [#​4315](https://togithub.com/mochajs/mocha/issues/4315): The `spec` option no longer supports a comma-delimited list of files ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND**: Use an array instead (e.g., `"spec": "foo.js,bar.js"` becomes `"spec": ["foo.js", "bar.js"]`). - [#​4309](https://togithub.com/mochajs/mocha/issues/4309): Drop support for Node.js v13.x line, which is now End-of-Life ([**@​juergba**](https://togithub.com/juergba)) - [#​4282](https://togithub.com/mochajs/mocha/issues/4282): `--forbid-only` will throw an error even if exclusive tests are avoided via `--grep` or other means ([**@​arvidOtt**](https://togithub.com/arvidOtt)) - [#​4223](https://togithub.com/mochajs/mocha/issues/4223): The context object's `skip()` (`this.skip()`) in a "before all" (`before()`) hook will no longer execute subsequent sibling hooks, in addition to hooks in child suites ([**@​juergba**](https://togithub.com/juergba)) - [#​4178](https://togithub.com/mochajs/mocha/issues/4178): Remove previously soft-deprecated APIs ([**@​wnghdcjfe**](https://togithub.com/wnghdcjfe)): - `Mocha.prototype.ignoreLeaks()` - `Mocha.prototype.useColors()` - `Mocha.prototype.useInlineDiffs()` - `Mocha.prototype.hideDiff()` #### :tada: Enhancements - [#​4245](https://togithub.com/mochajs/mocha/issues/4245): Add ability to run tests in parallel for Node.js (see [docs](https://mochajs.org/#parallel-tests)) ([**@​boneskull**](https://togithub.com/boneskull)) :exclamation: See also [#​4244](https://togithub.com/mochajs/mocha/issues/4244); [Root Hook Plugins (docs)](https://mochajs.org/#root-hook-plugins) -- _root hooks must be defined via Root Hook Plugins to work in parallel mode_ - [#​4304](https://togithub.com/mochajs/mocha/issues/4304): `--require` now works with ES modules ([**@​JacobLey**](https://togithub.com/JacobLey)) - [#​4299](https://togithub.com/mochajs/mocha/issues/4299): In some circumstances, Mocha can run ES modules under Node.js v10 -- _use at your own risk!_ ([**@​giltayar**](https://togithub.com/giltayar)) #### :book: Documentation - [#​4246](https://togithub.com/mochajs/mocha/issues/4246): Add documentation for parallel mode and Root Hook plugins ([**@​boneskull**](https://togithub.com/boneskull)) #### :bug: Fixes (All bug fixes in Mocha v8.0.0 are also breaking changes, and are listed above)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- packages/google-cloud-mediatranslation/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index a81b67fe853..67a93a366eb 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -39,7 +39,7 @@ "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.3", - "mocha": "^7.0.0", + "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 420207c0bb9..1c40036de26 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -19,6 +19,6 @@ "devDependencies": { "c8": "^7.0.0", "chai": "^4.2.0", - "mocha": "^7.0.0" + "mocha": "^8.0.0" } } From f29362b06b2efca01cfd29565188bf17db44837c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 11 Jun 2020 10:00:44 -0700 Subject: [PATCH 032/147] chore(nodejs_templates): add script logging to node_library populate-secrets.sh (#50) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/e306327b-605f-4c07-9420-c106e40c47d5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/e7034945fbdc0e79d3c57f6e299e5c90b0f11469 --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index efbcff1372b..1c3ff6cf538 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "6c52ff11511648eaa1fb10f647c9e369dea57cf9" + "sha": "2e5065b0ecb6c38148ec31bf8966617bf7d024d9" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1c92077459db3dc50741e878f98b08c6261181e0" + "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" } } ], From d2d12bd2c1be3067e7e74ee7f1bc8bba370ee51e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 15 Jun 2020 11:20:56 -0700 Subject: [PATCH 033/147] fix: proper fallback option handling autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- .../v1beta1/speech_translation_service_client.ts | 13 +++++-------- .../google-cloud-mediatranslation/synth.metadata | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 66eff03ed1e..c7b39554e63 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -99,14 +99,11 @@ export class SpeechTranslationServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the SpeechTranslationServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 1c3ff6cf538..d4c217863c3 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "2e5065b0ecb6c38148ec31bf8966617bf7d024d9" + "sha": "df3adcce7b4a2ebe827c1b57c81e6599142c2f1b" } }, { From e06a3bc9379b6835cb46e51120172d92e53f7d8d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 18 Jun 2020 07:48:35 -0700 Subject: [PATCH 034/147] chore: update node issue template (#52) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/37f383f8-7560-459e-b66c-def10ff830cb/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/b10590a4a1568548dd13cfcea9aa11d40898144b --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index d4c217863c3..2a19e423865 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "df3adcce7b4a2ebe827c1b57c81e6599142c2f1b" + "sha": "6331d9dd361a003c66ab532f904e1ae298ae296f" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" + "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" } } ], From 38851417e5ea67fce530faf1b03b7bd9529db97d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 27 Jun 2020 17:46:35 -0700 Subject: [PATCH 035/147] build: add config .gitattributes (#53) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/2a81bca4-7abd-4108-ac1f-21340f858709/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/dc9caca650c77b7039e2bbc3339ffb34ae78e5b7 --- packages/google-cloud-mediatranslation/.gitattributes | 3 +++ packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-mediatranslation/.gitattributes diff --git a/packages/google-cloud-mediatranslation/.gitattributes b/packages/google-cloud-mediatranslation/.gitattributes new file mode 100644 index 00000000000..2e63216ae9c --- /dev/null +++ b/packages/google-cloud-mediatranslation/.gitattributes @@ -0,0 +1,3 @@ +*.ts text eol=lf +*.js test eol=lf +protos/* linguist-generated diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 2a19e423865..44df78f2df5 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "6331d9dd361a003c66ab532f904e1ae298ae296f" + "sha": "ac02f0c0cf0ee98174cf0777cf40e16132ab873b" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" + "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" } } ], From b5f39d027fe80218d6679f7236326e1ecde16e0e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2020 15:05:47 -0700 Subject: [PATCH 036/147] chore: release 2.2.0 (#47) --- packages/google-cloud-mediatranslation/CHANGELOG.md | 13 +++++++++++++ packages/google-cloud-mediatranslation/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index b07e17ab3ec..72efb5389cd 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.2.0](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.1.0...v2.2.0) (2020-06-28) + + +### Features + +* move ts target to es2018 from es2016 ([#46](https://www.github.com/googleapis/nodejs-media-translation/issues/46)) ([2e5065b](https://www.github.com/googleapis/nodejs-media-translation/commit/2e5065b0ecb6c38148ec31bf8966617bf7d024d9)) +* **samples:** demonstrate real-time conversation translation ([#48](https://www.github.com/googleapis/nodejs-media-translation/issues/48)) ([6331d9d](https://www.github.com/googleapis/nodejs-media-translation/commit/6331d9dd361a003c66ab532f904e1ae298ae296f)) + + +### Bug Fixes + +* proper fallback option handling ([e0a5f7d](https://www.github.com/googleapis/nodejs-media-translation/commit/e0a5f7de5bd279e302b597ab73406de651d9937b)) + ## [2.1.0](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.0.0...v2.1.0) (2020-06-04) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 67a93a366eb..e2266ad5af4 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.1.0", + "version": "2.2.0", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 1c40036de26..1ecad5178a0 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.1.0", + "@google-cloud/media-translation": "^2.2.0", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From 72c6f7bbedb146054ca2027f99538c9205bd8788 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 6 Jul 2020 10:17:07 -0700 Subject: [PATCH 037/147] build: use bazel build (#54) --- .../synth.metadata | 18 +++++------------- .../google-cloud-mediatranslation/synth.py | 12 ++---------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 44df78f2df5..fae7ae23e08 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "ac02f0c0cf0ee98174cf0777cf40e16132ab873b" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "83816bb3093686a28af2891db5b7506614a820b1", - "internalRef": "310509915" + "remote": "git@github.com:googleapis/nodejs-media-translation.git", + "sha": "445872dbcc9c2133d56fc77aa2614fca66b77756" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" + "sha": "303271797a360f8a439203413f13a160f2f5b3b4" } } ], @@ -29,8 +21,8 @@ "source": "googleapis", "apiName": "mediatranslation", "apiVersion": "v1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } } ] diff --git a/packages/google-cloud-mediatranslation/synth.py b/packages/google-cloud-mediatranslation/synth.py index f513737044c..18a3c405014 100644 --- a/packages/google-cloud-mediatranslation/synth.py +++ b/packages/google-cloud-mediatranslation/synth.py @@ -24,19 +24,11 @@ # run the gapic generator -gapic = gcp.GAPICMicrogenerator() +gapic = gcp.GAPICBazel() versions = ['v1beta1'] name = 'mediatranslation' for version in versions: - library = gapic.typescript_library( - name, - generator_args={ - "grpc-service-config": f"google/cloud/{name}/{version}/{name}_grpc_service_config.json", - 'package-name': '@google-cloud/media-translation', - }, - extra_proto_files=['google/cloud/common_resources.proto'], - proto_path=f'/google/cloud/{name}/{version}', - version=version) + library = gapic.node_library(name, version) s.copy(library, excludes=['linkinator.config.json', 'package.json', 'README.md']) # Copy common templates From 6b7f8a3975df41b918439b1f8804bd4e89d13222 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 9 Jul 2020 20:36:43 -0700 Subject: [PATCH 038/147] chore: typeo in nodejs .gitattribute (#57) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/cc99acfa-05b8-434b-9500-2f6faf2eaa02/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b --- .../google-cloud-mediatranslation/.gitattributes | 2 +- .../google-cloud-mediatranslation/synth.metadata | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.gitattributes b/packages/google-cloud-mediatranslation/.gitattributes index 2e63216ae9c..d4f4169b28b 100644 --- a/packages/google-cloud-mediatranslation/.gitattributes +++ b/packages/google-cloud-mediatranslation/.gitattributes @@ -1,3 +1,3 @@ *.ts text eol=lf -*.js test eol=lf +*.js text eol=lf protos/* linguist-generated diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index fae7ae23e08..0fa0cecb5a6 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -3,15 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-media-translation.git", - "sha": "445872dbcc9c2133d56fc77aa2614fca66b77756" + "remote": "https://github.com/googleapis/nodejs-media-translation.git", + "sha": "ef437456659a418c6718f09462a4935295d22d9f" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", + "internalRef": "320300472" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "303271797a360f8a439203413f13a160f2f5b3b4" + "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" } } ], From fb43496355bb36b985e8e52afc240df5799db486 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jul 2020 18:51:05 +0200 Subject: [PATCH 039/147] chore(deps): update dependency ts-loader to v8 (#56) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/ts-loader/7.0.5/8.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v8.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v800) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v7.0.5...v8.0.0) - [Support for symlinks in project references](https://togithub.com/TypeStrong/ts-loader/pull/1136) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - `ts-loader` now supports TypeScript 3.6 and greater **BREAKING CHANGE**
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index e2266ad5af4..ff8fd679dab 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -43,7 +43,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^7.0.0", + "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.42.0", "webpack-cli": "^3.3.11" From fde31fb0f25b0727eaef8aec9f684132d00cc26d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 12 Jul 2020 18:48:34 +0200 Subject: [PATCH 040/147] chore(deps): update dependency @types/mocha to v8 (#58) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/7.0.2/8.0.0) | --- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index ff8fd679dab..1afbc7c74b0 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -30,7 +30,7 @@ "google-gax": "^2.1.0" }, "devDependencies": { - "@types/mocha": "^7.0.0", + "@types/mocha": "^8.0.0", "@types/node": "^12.12.29", "@types/sinon": "^9.0.0", "c8": "^7.1.0", From 3cf46fa7102e1f1e62efd6a4ddfbe4ada5da3cc2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 16 Jul 2020 09:14:11 -0700 Subject: [PATCH 041/147] build: fix typo in publish (#63) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5b03461e-47c0-40e8-a8ad-c465ee146cc5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/388e10f5ae302d3e8de1fac99f3a95d1ab8f824a Source-Link: https://github.com/googleapis/synthtool/commit/d82deccf657a66e31bd5da9efdb96c6fa322fc7e --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 0fa0cecb5a6..b7827158df1 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "ef437456659a418c6718f09462a4935295d22d9f" + "sha": "6af7a5c7ce97aedc36dd76631e07229961e039a6" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" + "sha": "388e10f5ae302d3e8de1fac99f3a95d1ab8f824a" } } ], From e2c684921ebaa5491e21e1e6921c8317eeb7bad4 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 17 Jul 2020 15:16:37 -0700 Subject: [PATCH 042/147] chore: add config files for cloud-rad for node.js (#64) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5e903fff-57bb-4395-bb94-8b4d1909dbf6/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/21f1470ecd01424dc91c70f1a7c798e4e87d1eec --- .../api-extractor.json | 369 ++++++++++++++++++ .../synth.metadata | 4 +- 2 files changed, 371 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-mediatranslation/api-extractor.json diff --git a/packages/google-cloud-mediatranslation/api-extractor.json b/packages/google-cloud-mediatranslation/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-mediatranslation/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-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index b7827158df1..002f5230c49 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "6af7a5c7ce97aedc36dd76631e07229961e039a6" + "sha": "4c17a809134936cd8916f2d420d953604cbd9b8c" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "388e10f5ae302d3e8de1fac99f3a95d1ab8f824a" + "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" } } ], From d1db2a9b8fcc145495403936edef2597ab9c1a73 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 21 Jul 2020 14:45:57 -0400 Subject: [PATCH 043/147] chore: add dev dependencies for cloud-rad ref docs (#65) --- packages/google-cloud-mediatranslation/package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 1afbc7c74b0..9f0f09de1a6 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -24,7 +24,9 @@ "lint": "gts check", "prelint": "cd samples; npm link ../; npm install", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "precompile": "gts clean" + "precompile": "gts clean", + "api-extractor": "api-extractor run --local", + "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { "google-gax": "^2.1.0" @@ -46,7 +48,9 @@ "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.42.0", - "webpack-cli": "^3.3.11" + "webpack-cli": "^3.3.11", + "@microsoft/api-documenter": "^7.8.10", + "@microsoft/api-extractor": "^7.8.10" }, "engines": { "node": ">=10" From 283901e56bb505cf35982bed54a9f474d774ede7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 21 Jul 2020 22:20:30 -0700 Subject: [PATCH 044/147] build: rename _toc to toc (#66) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/940354f9-15cd-4361-bbf4-dc9af1426979/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/99c93fe09f8c1dca09dfc0301c8668e3a70dd796 --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 002f5230c49..67aac82a0e6 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "4c17a809134936cd8916f2d420d953604cbd9b8c" + "sha": "9de3b45190be67863176c083fe977fcfc947f45a" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" + "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" } } ], From a1653e936323a076091ebb6032545f00f0d00529 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 23 Jul 2020 20:06:35 -0700 Subject: [PATCH 045/147] chore: move gitattributes files to node templates (#67) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/d43b90cc-a087-4c57-864c-1e4f93292dc6/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 --- packages/google-cloud-mediatranslation/.gitattributes | 1 + packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.gitattributes b/packages/google-cloud-mediatranslation/.gitattributes index d4f4169b28b..33739cb74e4 100644 --- a/packages/google-cloud-mediatranslation/.gitattributes +++ b/packages/google-cloud-mediatranslation/.gitattributes @@ -1,3 +1,4 @@ *.ts text eol=lf *.js text eol=lf protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 67aac82a0e6..d9685096a40 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "9de3b45190be67863176c083fe977fcfc947f45a" + "sha": "c1aa2e15e2e754fba7a3878868d59a7e20e82674" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" + "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" } } ], From 92414dc47f6c3e48520b51c7a5eabfbc2d403f15 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 29 Jul 2020 16:36:21 -0700 Subject: [PATCH 046/147] chore(node): fix kokoro build path for cloud-rad (#68) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4bdc1826-2f69-49f1-a63b-94f99cceb5ee/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index d9685096a40..7816211a3b0 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "c1aa2e15e2e754fba7a3878868d59a7e20e82674" + "sha": "4339b7232f3ea1fc71c87b1852dc37ca3be46f58" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" + "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" } } ], From 32c376355006ff36a18e7b77a16c6f5a024dea95 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 30 Jul 2020 19:43:19 -0700 Subject: [PATCH 047/147] build: protos update --- packages/google-cloud-mediatranslation/protos/protos.d.ts | 2 +- packages/google-cloud-mediatranslation/protos/protos.js | 2 +- packages/google-cloud-mediatranslation/synth.metadata | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts index 32347bb72ba..0e1eb0ccfb1 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.d.ts +++ b/packages/google-cloud-mediatranslation/protos/protos.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import * as Long from "long"; -import * as $protobuf from "protobufjs"; +import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index 54141277f59..e21e6894b8d 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -19,7 +19,7 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("protobufjs/minimal")); + module.exports = factory(require("google-gax").protobufMinimal); })(this, function($protobuf) { "use strict"; diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 7816211a3b0..2955cdba300 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "4339b7232f3ea1fc71c87b1852dc37ca3be46f58" + "sha": "d736a96ccac56419d29e22e302e0751c8e7d16ab" } }, { From d1e92b08a3169ab482fb53f6f4b6fb829491f9f3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 2 Aug 2020 21:52:04 -0700 Subject: [PATCH 048/147] docs: add links to the CHANGELOG from the README.md for Java and Node (#70) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7b446397-88f3-4463-9e7d-d2ce7069989d/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5936421202fb53ed4641bcb824017dd393a3dbcc --- packages/google-cloud-mediatranslation/README.md | 3 +++ packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index 677726c874a..28256c7957c 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -14,6 +14,9 @@ Mediatranslation client for Node.js +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-media-translation/blob/master/CHANGELOG.md). + * [Cloud Media Translation Node.js Client API Reference][client-docs] * [Cloud Media Translation Documentation][product-docs] * [github.com/googleapis/nodejs-media-translation](https://github.com/googleapis/nodejs-media-translation) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 2955cdba300..f9d987323b2 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "d736a96ccac56419d29e22e302e0751c8e7d16ab" + "sha": "039fc5e9fd51cec8d6dc9176e4f456e8b5fec1ed" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" + "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" } } ], From 2cf9b9745e05121d1b6b32b5c11c55cec678b5f5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 10 Aug 2020 10:56:09 -0700 Subject: [PATCH 049/147] build: --credential-file-override is no longer required (#72) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4de22315-84b1-493d-8da2-dfa7688128f5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/94421c47802f56a44c320257b2b4c190dc7d6b68 --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index f9d987323b2..f6eb0992157 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "039fc5e9fd51cec8d6dc9176e4f456e8b5fec1ed" + "sha": "7ec33f4f1c93d8c991e34e06c4bcc5f80bc68f3b" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" + "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" } } ], From 54e68467474ba4a00bafb3fd45efa6b3a3e0531e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 Aug 2020 09:36:33 -0700 Subject: [PATCH 050/147] chore: update cloud rad kokoro build job (#74) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b742586e-df31-4aac-8092-78288e9ea8e7/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/bd0deaa1113b588d70449535ab9cbf0f2bd0e72f --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index f6eb0992157..1954e068684 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "7ec33f4f1c93d8c991e34e06c4bcc5f80bc68f3b" + "sha": "ea94ade7e784addae3158d4953bd8f43710b3bcc" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" + "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" } } ], From 3abe91302dd847ff5cd6b87cdf68e3e80bd8f488 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 Aug 2020 13:08:08 -0700 Subject: [PATCH 051/147] build: use gapic-generator-typescript v1.0.7. (#73) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b742586e-df31-4aac-8092-78288e9ea8e7/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 325949033 Source-Link: https://github.com/googleapis/googleapis/commit/94006b3cb8d2fb44703cf535da15608eed6bf7db --- .../src/v1beta1/speech_translation_service_client.ts | 5 ++--- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index c7b39554e63..41b077794b0 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -217,12 +217,11 @@ export class SpeechTranslationServiceClient { } ); + const descriptor = this.descriptors.stream[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 1954e068684..34e2146961b 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -11,8 +11,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", - "internalRef": "320300472" + "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", + "internalRef": "325949033" } }, { From c44e21afb1c84332474108647b87d53699a6b758 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 13 Aug 2020 12:40:18 -0700 Subject: [PATCH 052/147] build: perform publish using Node 12 (#75) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/c36c6dbc-ab79-4f17-b70b-523b420b2a70/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5747555f7620113d9a2078a48f4c047a99d31b3e --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 34e2146961b..e416747a4ff 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "ea94ade7e784addae3158d4953bd8f43710b3bcc" + "sha": "57cbd49d6f804952b633ebc33668974e9a8f9d2c" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" + "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" } } ], From 89203468164ac82294e0534a9920f0a53e4fb1cf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 19 Aug 2020 09:42:41 -0700 Subject: [PATCH 053/147] chore: start tracking obsolete files (#76) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7a1b0b96-8ddb-4836-a1a2-d2f73b7e6ffe/targets - [ ] To automatically regenerate this PR, check this box. --- .../synth.metadata | 79 ++++++++++++++++++- 1 file changed, 75 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index e416747a4ff..440ffab0bc3 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "57cbd49d6f804952b633ebc33668974e9a8f9d2c" + "sha": "96c17d04d6a6d3e2d24da01e5a73201a8af61284" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", - "internalRef": "325949033" + "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", + "internalRef": "327369997" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" + "sha": "1a60ff2a3975c2f5054431588bd95db9c3b862ba" } } ], @@ -33,5 +33,76 @@ "generator": "bazel" } } + ], + "generatedFiles": [ + ".eslintignore", + ".eslintrc.json", + ".gitattributes", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/publish.yml", + ".github/release-please.yml", + ".github/workflows/ci.yaml", + ".gitignore", + ".jsdoc.js", + ".kokoro/.gitattributes", + ".kokoro/common.cfg", + ".kokoro/continuous/node10/common.cfg", + ".kokoro/continuous/node10/docs.cfg", + ".kokoro/continuous/node10/lint.cfg", + ".kokoro/continuous/node10/samples-test.cfg", + ".kokoro/continuous/node10/system-test.cfg", + ".kokoro/continuous/node10/test.cfg", + ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/test.cfg", + ".kokoro/docs.sh", + ".kokoro/lint.sh", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/node10/common.cfg", + ".kokoro/presubmit/node10/samples-test.cfg", + ".kokoro/presubmit/node10/system-test.cfg", + ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/test.cfg", + ".kokoro/publish.sh", + ".kokoro/release/docs-devsite.cfg", + ".kokoro/release/docs-devsite.sh", + ".kokoro/release/docs.cfg", + ".kokoro/release/docs.sh", + ".kokoro/release/publish.cfg", + ".kokoro/samples-test.sh", + ".kokoro/system-test.sh", + ".kokoro/test.bat", + ".kokoro/test.sh", + ".kokoro/trampoline.sh", + ".mocharc.js", + ".nycrc", + ".prettierignore", + ".prettierrc.js", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "README.md", + "api-extractor.json", + "package-lock.json.1098915313", + "protos/google/cloud/mediatranslation/v1beta1/media_translation.proto", + "protos/protos.d.ts", + "protos/protos.js", + "protos/protos.json", + "renovate.json", + "samples/README.md", + "samples/package-lock.json.2366756089", + "src/index.ts", + "src/v1beta1/index.ts", + "src/v1beta1/speech_translation_service_client.ts", + "src/v1beta1/speech_translation_service_client_config.json", + "src/v1beta1/speech_translation_service_proto_list.json", + "system-test/fixtures/sample/src/index.js", + "system-test/fixtures/sample/src/index.ts", + "system-test/install.ts", + "test/gapic_speech_translation_service_v1beta1.ts", + "tsconfig.json", + "webpack.config.js" ] } \ No newline at end of file From a33c65be94b340e07e082ae7d9c812128f831248 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 21 Aug 2020 11:12:17 -0700 Subject: [PATCH 054/147] build: move system and samples test from Node 10 to Node 12 (#77) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/ba2d388f-b3b2-4ad7-a163-0c6b4d86894f/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/05de3e1e14a0b07eab8b474e669164dbd31f81fb --- .../google-cloud-mediatranslation/synth.metadata | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 440ffab0bc3..41f1df7a13a 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "96c17d04d6a6d3e2d24da01e5a73201a8af61284" + "sha": "c51b0b1c44793ba03c3251f724d3f1b7a84cbae1" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1a60ff2a3975c2f5054431588bd95db9c3b862ba" + "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" } } ], @@ -51,19 +51,19 @@ ".kokoro/common.cfg", ".kokoro/continuous/node10/common.cfg", ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/lint.cfg", - ".kokoro/continuous/node10/samples-test.cfg", - ".kokoro/continuous/node10/system-test.cfg", ".kokoro/continuous/node10/test.cfg", ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/lint.cfg", + ".kokoro/continuous/node12/samples-test.cfg", + ".kokoro/continuous/node12/system-test.cfg", ".kokoro/continuous/node12/test.cfg", ".kokoro/docs.sh", ".kokoro/lint.sh", ".kokoro/populate-secrets.sh", ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node10/samples-test.cfg", - ".kokoro/presubmit/node10/system-test.cfg", ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/samples-test.cfg", + ".kokoro/presubmit/node12/system-test.cfg", ".kokoro/presubmit/node12/test.cfg", ".kokoro/publish.sh", ".kokoro/release/docs-devsite.cfg", @@ -85,14 +85,12 @@ "LICENSE", "README.md", "api-extractor.json", - "package-lock.json.1098915313", "protos/google/cloud/mediatranslation/v1beta1/media_translation.proto", "protos/protos.d.ts", "protos/protos.js", "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.2366756089", "src/index.ts", "src/v1beta1/index.ts", "src/v1beta1/speech_translation_service_client.ts", From 1796ff9281a7549d65652e60df2f58ec884783a9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 27 Aug 2020 09:26:20 -0700 Subject: [PATCH 055/147] build: track flaky tests for "nightly", add new secrets for tagging (#78) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/a8c1e885-336c-4636-8e00-e4134524f8ee/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/8cf6d2834ad14318e64429c3b94f6443ae83daf9 --- packages/google-cloud-mediatranslation/synth.metadata | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 41f1df7a13a..7ab02e1fff1 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "c51b0b1c44793ba03c3251f724d3f1b7a84cbae1" + "sha": "a73a6a0555a0b3f0176a071b2220175277e1a0a1" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" + "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" } } ], @@ -42,7 +42,6 @@ ".github/ISSUE_TEMPLATE/feature_request.md", ".github/ISSUE_TEMPLATE/support_request.md", ".github/PULL_REQUEST_TEMPLATE.md", - ".github/publish.yml", ".github/release-please.yml", ".github/workflows/ci.yaml", ".gitignore", From 45df58d0017041cb8daecac449bcef4cbc792cfe Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 12 Sep 2020 14:06:24 -0700 Subject: [PATCH 056/147] build(test): recursively find test files; fail on unsupported dependency versions (#81) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/0832b96d-f20d-428a-9244-9373d24004a9/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/fdd03c161003ab97657cc0218f25c82c89ddf4b6 --- packages/google-cloud-mediatranslation/.mocharc.js | 3 ++- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.mocharc.js b/packages/google-cloud-mediatranslation/.mocharc.js index ff7b34fa5d1..0b600509bed 100644 --- a/packages/google-cloud-mediatranslation/.mocharc.js +++ b/packages/google-cloud-mediatranslation/.mocharc.js @@ -14,7 +14,8 @@ const config = { "enable-source-maps": true, "throw-deprecation": true, - "timeout": 10000 + "timeout": 10000, + "recursive": true } if (process.env.MOCHA_THROW_DEPRECATION === 'false') { delete config['throw-deprecation']; diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 7ab02e1fff1..8d97e82b528 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "a73a6a0555a0b3f0176a071b2220175277e1a0a1" + "sha": "8bf7649660458ee6dbf77e36a9ae13ede0ba5195" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" + "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" } } ], From 3c76e216d85b2c7465b6a30e5bf677b4eba3558c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 2 Oct 2020 08:10:07 -0700 Subject: [PATCH 057/147] chore: update bucket for cloud-rad (#82) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/abddcc47-cb76-4fc4-b8c1-feafeaf13e14/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/079dcce498117f9570cebe6e6cff254b38ba3860 --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 8d97e82b528..677acce6404 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "8bf7649660458ee6dbf77e36a9ae13ede0ba5195" + "sha": "23f7a28bf4dd4533f15f3d3eddcdd50662f77f44" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" } } ], From 635c123182243cdc11a1fe8ae79fcfe9f3669150 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Oct 2020 10:42:42 -0700 Subject: [PATCH 058/147] build(node_library): migrate to Trampoline V2 (#83) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/1e3d0729-fe1f-4f75-babe-29f5584e5b6a/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9 --- packages/google-cloud-mediatranslation/synth.metadata | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 677acce6404..b6a8fd34072 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "23f7a28bf4dd4533f15f3d3eddcdd50662f77f44" + "sha": "c161a6fcdf1a45cf29cb4607c0c07cd6a72ff79b" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" + "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" } } ], @@ -75,10 +75,12 @@ ".kokoro/test.bat", ".kokoro/test.sh", ".kokoro/trampoline.sh", + ".kokoro/trampoline_v2.sh", ".mocharc.js", ".nycrc", ".prettierignore", ".prettierrc.js", + ".trampolinerc", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "LICENSE", From 64b2b32f92dbe0a727eb5afe5b238eead06953bf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 12 Oct 2020 21:54:30 +0200 Subject: [PATCH 059/147] chore(deps): update dependency webpack-cli to v4 (#86) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack-cli](https://togithub.com/webpack/webpack-cli) | devDependencies | major | [`^3.3.11` -> `^4.0.0`](https://renovatebot.com/diffs/npm/webpack-cli/3.3.12/4.0.0) | --- ### Release Notes
webpack/webpack-cli ### [`v4.0.0`](https://togithub.com/webpack/webpack-cli/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpackwebpack-clicomparewebpack-cli400-rc1webpack-cli400-2020-10-10) [Compare Source](https://togithub.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.0.0) ##### Bug Fixes - add compilation lifecycle in watch instance ([#​1903](https://togithub.com/webpack/webpack-cli/issues/1903)) ([02b6d21](https://togithub.com/webpack/webpack-cli/commit/02b6d21eaa20166a7ed37816de716b8fc22b756a)) - cleanup `package-utils` package ([#​1822](https://togithub.com/webpack/webpack-cli/issues/1822)) ([fd5b92b](https://togithub.com/webpack/webpack-cli/commit/fd5b92b3cd40361daec5bf4486e455a41f4c9738)) - cli-executer supplies args further up ([#​1904](https://togithub.com/webpack/webpack-cli/issues/1904)) ([097564a](https://togithub.com/webpack/webpack-cli/commit/097564a851b36b63e0a6bf88144997ef65aa057a)) - exit code for validation errors ([59f6303](https://togithub.com/webpack/webpack-cli/commit/59f63037fcbdbb8934b578b9adf5725bc4ae1235)) - exit process in case of schema errors ([71e89b4](https://togithub.com/webpack/webpack-cli/commit/71e89b4092d953ea587cc4f606451ab78cbcdb93)) ##### Features - assign config paths in build dependencies in cache config ([#​1900](https://togithub.com/webpack/webpack-cli/issues/1900)) ([7e90f11](https://togithub.com/webpack/webpack-cli/commit/7e90f110b119f36ef9def4f66cf4e17ccf1438cd))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 9f0f09de1a6..6232f5b347c 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -48,7 +48,7 @@ "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.42.0", - "webpack-cli": "^3.3.11", + "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" }, From 0735e47a2be7a5df0dc92ef3e9bd4315306785b5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 15 Oct 2020 01:38:06 +0200 Subject: [PATCH 060/147] chore(deps): update dependency webpack to v5 (#85) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack](https://togithub.com/webpack/webpack) | devDependencies | major | [`^4.42.0` -> `^5.0.0`](https://renovatebot.com/diffs/npm/webpack/4.44.2/5.1.0) | --- ### Release Notes
webpack/webpack ### [`v5.1.0`](https://togithub.com/webpack/webpack/releases/v5.1.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.0.0...v5.1.0) ### Features - expose `webpack` property from `Compiler` - expose `cleverMerge`, `EntryOptionPlugin`, `DynamicEntryPlugin` ### Bugfixes - missing `require("..").xxx` in try-catch produces a warning instead of an error now - handle reexports in concatenated modules correctly when they are side-effect-free - fix incorrect deprecation message for ModuleTemplate.hooks.hash ### [`v5.0.0`](https://togithub.com/webpack/webpack/releases/v5.0.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v4.44.2...v5.0.0) [Announcement and changelog](https://webpack.js.org/blog/2020-10-10-webpack-5-release/)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 6232f5b347c..f8dea2b6979 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -47,7 +47,7 @@ "sinon": "^9.0.1", "ts-loader": "^8.0.0", "typescript": "^3.8.3", - "webpack": "^4.42.0", + "webpack": "^5.0.0", "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" From 971911ce42f6528b4c0c4b37123510ea690460cd Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 16 Oct 2020 10:08:33 -0700 Subject: [PATCH 061/147] build: only check --engine-strict for production deps (#87) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/05b05b53-a254-4e87-acf9-e9bae7f17a4e/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5451633881133e5573cc271a18e73b18caca8b1b --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index b6a8fd34072..4fdf8cd3c52 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "c161a6fcdf1a45cf29cb4607c0c07cd6a72ff79b" + "sha": "2c092ea62d5dc0bbd3e4ab3472297668381c18fd" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" + "sha": "5451633881133e5573cc271a18e73b18caca8b1b" } } ], From 90dad3288aefd78ae12efb65ab07b2706e02ff3c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 21 Oct 2020 11:24:13 -0700 Subject: [PATCH 062/147] chore: clean up Node.js TOC for cloud-rad (#88) * chore: clean up Node.js TOC for cloud-rad Source-Author: F. Hinkelmann Source-Date: Wed Oct 21 09:26:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 Source-Link: https://github.com/googleapis/synthtool/commit/f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 * chore: fix Node.js TOC for cloud-rad Source-Author: F. Hinkelmann Source-Date: Wed Oct 21 12:01:24 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 901ddd44e9ef7887ee681b9183bbdea99437fdcc Source-Link: https://github.com/googleapis/synthtool/commit/901ddd44e9ef7887ee681b9183bbdea99437fdcc --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 4fdf8cd3c52..cb4af1366ea 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "2c092ea62d5dc0bbd3e4ab3472297668381c18fd" + "sha": "97cad2371be31c4fec453de94cf6e49516c9c4bf" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5451633881133e5573cc271a18e73b18caca8b1b" + "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" } } ], From c9f5f110d9240cb5be4bdeb84057cd462c85f8fa Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Oct 2020 11:12:11 -0700 Subject: [PATCH 063/147] docs: updated code of conduct (includes update to actions) (#92) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/8603a334-7a64-49dc-bf6d-29ff55473bfe/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/89c849ba5013e45e8fb688b138f33c2ec6083dc5 Source-Link: https://github.com/googleapis/synthtool/commit/a783321fd55f010709294455584a553f4b24b944 Source-Link: https://github.com/googleapis/synthtool/commit/b7413d38b763827c72c0360f0a3d286c84656eeb Source-Link: https://github.com/googleapis/synthtool/commit/5f6ef0ec5501d33c4667885b37a7685a30d41a76 --- .../CODE_OF_CONDUCT.md | 123 +++++++++++++----- .../synth.metadata | 4 +- 2 files changed, 89 insertions(+), 38 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CODE_OF_CONDUCT.md b/packages/google-cloud-mediatranslation/CODE_OF_CONDUCT.md index 46b2a08ea6d..2add2547a81 100644 --- a/packages/google-cloud-mediatranslation/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-mediatranslation/CODE_OF_CONDUCT.md @@ -1,43 +1,94 @@ -# Contributor Code of Conduct + +# Code of Conduct -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. +## Our Pledge -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index cb4af1366ea..ecb297b93c6 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "97cad2371be31c4fec453de94cf6e49516c9c4bf" + "sha": "8f1d36b05dcdf3529b59c57574c2c473c608e68b" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" + "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" } } ], From e01b19f2d8ed22b64c7f801b7d27e048551a7104 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 2 Nov 2020 15:59:00 -0800 Subject: [PATCH 064/147] build(node): add KOKORO_BUILD_ARTIFACTS_SUBDIR to env (#93) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/2b12f6c9-10d8-4a5e-b86e-af5827858559/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/ba9918cd22874245b55734f57470c719b577e591 --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index ecb297b93c6..afea6c5d79d 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "8f1d36b05dcdf3529b59c57574c2c473c608e68b" + "sha": "c1a44314dd7b73faa69e3a7fe1edde54266c3a88" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" + "sha": "ba9918cd22874245b55734f57470c719b577e591" } } ], From a832d82396688a7f89e2b189189027d3740f00e6 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 6 Nov 2020 16:56:38 -0800 Subject: [PATCH 065/147] fix: do not modify options object, use defaultScopes (#94) * fix: do not modify options object, use defaultScopes Regenerated the library using gapic-generator-typescript v1.2.1. * fix(deps): require google-gax ^2.9.2 --- .../package.json | 2 +- .../src/index.ts | 1 + .../speech_translation_service_client.ts | 76 +++++++++++-------- .../synth.metadata | 16 ++-- .../system-test/fixtures/sample/src/index.ts | 11 ++- .../system-test/install.ts | 18 ++--- 6 files changed, 69 insertions(+), 55 deletions(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index f8dea2b6979..e8ab979f1e8 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -29,7 +29,7 @@ "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { - "google-gax": "^2.1.0" + "google-gax": "^2.9.2" }, "devDependencies": { "@types/mocha": "^8.0.0", diff --git a/packages/google-cloud-mediatranslation/src/index.ts b/packages/google-cloud-mediatranslation/src/index.ts index c2bc720e777..59d0bd1cc40 100644 --- a/packages/google-cloud-mediatranslation/src/index.ts +++ b/packages/google-cloud-mediatranslation/src/index.ts @@ -18,6 +18,7 @@ import * as v1beta1 from './v1beta1'; const SpeechTranslationServiceClient = v1beta1.SpeechTranslationServiceClient; +type SpeechTranslationServiceClient = v1beta1.SpeechTranslationServiceClient; export {v1beta1, SpeechTranslationServiceClient}; export default {v1beta1, SpeechTranslationServiceClient}; import * as protos from '../protos/protos'; diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 41b077794b0..7aa8e06fc5a 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -50,8 +50,10 @@ export class SpeechTranslationServiceClient { /** * Construct an instance of SpeechTranslationServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] @@ -71,44 +73,34 @@ export class SpeechTranslationServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} fallback - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof SpeechTranslationServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - if (!opts) { - opts = {servicePath, port}; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the SpeechTranslationServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this - .constructor as typeof SpeechTranslationServiceClient).scopes; + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); // Save options to use in initialize() method. @@ -117,6 +109,11 @@ export class SpeechTranslationServiceClient { // 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) { @@ -232,6 +229,7 @@ export class SpeechTranslationServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'mediatranslation.googleapis.com'; @@ -240,6 +238,7 @@ export class SpeechTranslationServiceClient { /** * 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 'mediatranslation.googleapis.com'; @@ -247,6 +246,7 @@ export class SpeechTranslationServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -255,6 +255,7 @@ export class SpeechTranslationServiceClient { /** * 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']; @@ -264,8 +265,7 @@ export class SpeechTranslationServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -291,6 +291,15 @@ export class SpeechTranslationServiceClient { * An object stream which is both readable and writable. It accepts objects * representing [StreamingTranslateSpeechRequest]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest} for write() method, and * will emit objects representing [StreamingTranslateSpeechResponse]{@link google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse} on 'data' event asynchronously. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) + * for more details and examples. + * @example + * const stream = client.streamingTranslateSpeech(); + * stream.on('data', (response) => { ... }); + * stream.on('end', () => { ... }); + * stream.write(request); + * stream.end(); */ streamingTranslateSpeech(options?: gax.CallOptions): gax.CancellableStream { this.initialize(); @@ -298,9 +307,10 @@ export class SpeechTranslationServiceClient { } /** - * Terminate the GRPC channel and close the client. + * Terminate the gRPC channel and close the client. * * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { this.initialize(); diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index afea6c5d79d..32f3a76aefc 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "c1a44314dd7b73faa69e3a7fe1edde54266c3a88" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", - "internalRef": "327369997" + "remote": "git@github.com:googleapis/nodejs-media-translation.git", + "sha": "f132c7b2725509ef3d4d497733ba85f851b52789" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ba9918cd22874245b55734f57470c719b577e591" + "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" } } ], @@ -86,12 +78,14 @@ "LICENSE", "README.md", "api-extractor.json", + "package-lock.json.3635725974", "protos/google/cloud/mediatranslation/v1beta1/media_translation.proto", "protos/protos.d.ts", "protos/protos.js", "protos/protos.json", "renovate.json", "samples/README.md", + "samples/package-lock.json.3114264012", "src/index.ts", "src/v1beta1/index.ts", "src/v1beta1/speech_translation_service_client.ts", diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts index 41e2683eee2..dbc5846cd73 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts @@ -18,8 +18,17 @@ import {SpeechTranslationServiceClient} from '@google-cloud/media-translation'; +// check that the client class type name can be used +function doStuffWithSpeechTranslationServiceClient( + client: SpeechTranslationServiceClient +) { + client.close(); +} + function main() { - new SpeechTranslationServiceClient(); + // check that the client instance can be created + const speechTranslationServiceClient = new SpeechTranslationServiceClient(); + doStuffWithSpeechTranslationServiceClient(speechTranslationServiceClient); } main(); diff --git a/packages/google-cloud-mediatranslation/system-test/install.ts b/packages/google-cloud-mediatranslation/system-test/install.ts index 4c1ba3eb79a..39d90f771de 100644 --- a/packages/google-cloud-mediatranslation/system-test/install.ts +++ b/packages/google-cloud-mediatranslation/system-test/install.ts @@ -20,32 +20,32 @@ import {packNTest} from 'pack-n-play'; import {readFileSync} from 'fs'; import {describe, it} from 'mocha'; -describe('typescript consumer tests', () => { - it('should have correct type signature for typescript users', async function () { +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'TypeScript user can use the type definitions', ts: readFileSync( './system-test/fixtures/sample/src/index.ts' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); - it('should have correct type signature for javascript users', async function () { + it('JavaScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'JavaScript user can use the library', ts: readFileSync( './system-test/fixtures/sample/src/index.js' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); }); From d80fd61056042f0f809d38c2fedca010d679b018 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2020 14:28:05 -0800 Subject: [PATCH 066/147] chore: release 2.2.1 (#95) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-mediatranslation/CHANGELOG.md | 7 +++++++ packages/google-cloud-mediatranslation/package.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index 72efb5389cd..271bb8ddc36 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.2.1](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.2.0...v2.2.1) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#94](https://www.github.com/googleapis/nodejs-media-translation/issues/94)) ([5c6d930](https://www.github.com/googleapis/nodejs-media-translation/commit/5c6d930f215a55b876fcda36a1c448aca2b92b8f)) + ## [2.2.0](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.1.0...v2.2.0) (2020-06-28) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index e8ab979f1e8..d6dc0789892 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.2.0", + "version": "2.2.1", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 1ecad5178a0..ee2eeeb011d 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.2.0", + "@google-cloud/media-translation": "^2.2.1", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From 5d56cefc6bdcc8855baa9d374e9711d75e88385b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Nov 2020 12:40:15 -0800 Subject: [PATCH 067/147] fix(browser): check for fetch on window --- .../speech_translation_service_client.ts | 18 +++++++++++++----- .../synth.metadata | 14 ++++++++++---- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 7aa8e06fc5a..7f04f6705e1 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -16,11 +16,17 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/speech_translation_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './speech_translation_service_client_config.json'; const version = require('../../../package.json').version; @@ -73,9 +79,9 @@ export class SpeechTranslationServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -89,7 +95,9 @@ export class SpeechTranslationServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -301,7 +309,7 @@ export class SpeechTranslationServiceClient { * stream.write(request); * stream.end(); */ - streamingTranslateSpeech(options?: gax.CallOptions): gax.CancellableStream { + streamingTranslateSpeech(options?: CallOptions): gax.CancellableStream { this.initialize(); return this.innerApiCalls.streamingTranslateSpeech(options); } diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 32f3a76aefc..e5578dcf866 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -3,8 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-media-translation.git", - "sha": "f132c7b2725509ef3d4d497733ba85f851b52789" + "remote": "https://github.com/googleapis/nodejs-media-translation.git", + "sha": "f58a09e23452b1407079078809d079b2c31775f4" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "2f019bf70bfe06f1e2af1b04011b0a2405190e43", + "internalRef": "343202295" } }, { @@ -78,14 +86,12 @@ "LICENSE", "README.md", "api-extractor.json", - "package-lock.json.3635725974", "protos/google/cloud/mediatranslation/v1beta1/media_translation.proto", "protos/protos.d.ts", "protos/protos.js", "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.3114264012", "src/index.ts", "src/v1beta1/index.ts", "src/v1beta1/speech_translation_service_client.ts", From 90c070d55a02155fe2a255d0dd8d24317f776b6e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Nov 2020 08:36:13 -0800 Subject: [PATCH 068/147] docs: spelling correction for "targetting" (#99) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/0d9476f5-156e-4a9b-9f97-94473eb544b9/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/15013eff642a7e7e855aed5a29e6e83c39beba2a --- .../google-cloud-mediatranslation/README.md | 2 +- .../synth.metadata | 74 +------------------ 2 files changed, 3 insertions(+), 73 deletions(-) diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index 28256c7957c..eb3b46e0c87 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -156,7 +156,7 @@ Our client libraries follow the [Node.js release schedule](https://nodejs.org/en Libraries are compatible with all current _active_ and _maintenance_ versions of Node.js. -Client libraries targetting some end-of-life versions of Node.js are available, and +Client libraries targeting some end-of-life versions of Node.js are available, and can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). The dist-tags follow the naming convention `legacy-(version)`. diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index e5578dcf866..730741dcbf2 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "f58a09e23452b1407079078809d079b2c31775f4" + "sha": "c0245c54d8c45f1f3171e9066bc7bab3c4162b69" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" + "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" } } ], @@ -33,75 +33,5 @@ "generator": "bazel" } } - ], - "generatedFiles": [ - ".eslintignore", - ".eslintrc.json", - ".gitattributes", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/release-please.yml", - ".github/workflows/ci.yaml", - ".gitignore", - ".jsdoc.js", - ".kokoro/.gitattributes", - ".kokoro/common.cfg", - ".kokoro/continuous/node10/common.cfg", - ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/test.cfg", - ".kokoro/continuous/node12/common.cfg", - ".kokoro/continuous/node12/lint.cfg", - ".kokoro/continuous/node12/samples-test.cfg", - ".kokoro/continuous/node12/system-test.cfg", - ".kokoro/continuous/node12/test.cfg", - ".kokoro/docs.sh", - ".kokoro/lint.sh", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node12/common.cfg", - ".kokoro/presubmit/node12/samples-test.cfg", - ".kokoro/presubmit/node12/system-test.cfg", - ".kokoro/presubmit/node12/test.cfg", - ".kokoro/publish.sh", - ".kokoro/release/docs-devsite.cfg", - ".kokoro/release/docs-devsite.sh", - ".kokoro/release/docs.cfg", - ".kokoro/release/docs.sh", - ".kokoro/release/publish.cfg", - ".kokoro/samples-test.sh", - ".kokoro/system-test.sh", - ".kokoro/test.bat", - ".kokoro/test.sh", - ".kokoro/trampoline.sh", - ".kokoro/trampoline_v2.sh", - ".mocharc.js", - ".nycrc", - ".prettierignore", - ".prettierrc.js", - ".trampolinerc", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "README.md", - "api-extractor.json", - "protos/google/cloud/mediatranslation/v1beta1/media_translation.proto", - "protos/protos.d.ts", - "protos/protos.js", - "protos/protos.json", - "renovate.json", - "samples/README.md", - "src/index.ts", - "src/v1beta1/index.ts", - "src/v1beta1/speech_translation_service_client.ts", - "src/v1beta1/speech_translation_service_client_config.json", - "src/v1beta1/speech_translation_service_proto_list.json", - "system-test/fixtures/sample/src/index.js", - "system-test/fixtures/sample/src/index.ts", - "system-test/install.ts", - "test/gapic_speech_translation_service_v1beta1.ts", - "tsconfig.json", - "webpack.config.js" ] } \ No newline at end of file From 0ac6e2f6885b078d16191a12f11a066d599d7d20 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:42:13 +0000 Subject: [PATCH 069/147] chore: release 2.2.2 (#98) :robot: I have created a release \*beep\* \*boop\* --- ### [2.2.2](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.2.1...v2.2.2) (2020-11-25) ### Bug Fixes * **browser:** check for fetch on window ([c0245c5](https://www.github.com/googleapis/nodejs-media-translation/commit/c0245c54d8c45f1f3171e9066bc7bab3c4162b69)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-mediatranslation/CHANGELOG.md | 7 +++++++ packages/google-cloud-mediatranslation/package.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index 271bb8ddc36..743a39772d6 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.2.2](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.2.1...v2.2.2) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([c0245c5](https://www.github.com/googleapis/nodejs-media-translation/commit/c0245c54d8c45f1f3171e9066bc7bab3c4162b69)) + ### [2.2.1](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.2.0...v2.2.1) (2020-11-07) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index d6dc0789892..89482e64057 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.2.1", + "version": "2.2.2", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index ee2eeeb011d..4253c36bfa5 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.2.1", + "@google-cloud/media-translation": "^2.2.2", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From a19beae7510db1ab44e60a75352fb78c899357f5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 4 Dec 2020 08:56:12 -0800 Subject: [PATCH 070/147] chore: generate GAPIC metadata JSON file (#100) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/86075bca-3db9-4047-98b6-39dbe4174275/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 345596855 Source-Link: https://github.com/googleapis/googleapis/commit/d189e871205fea665a9648f7c4676f027495ccaf --- .../src/v1beta1/gapic_metadata.json | 27 +++++++++++++++++++ .../synth.metadata | 6 ++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-mediatranslation/src/v1beta1/gapic_metadata.json diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/gapic_metadata.json b/packages/google-cloud-mediatranslation/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..0a32f7ae25f --- /dev/null +++ b/packages/google-cloud-mediatranslation/src/v1beta1/gapic_metadata.json @@ -0,0 +1,27 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.mediatranslation.v1beta1", + "libraryPackage": "@google-cloud/media-translation", + "services": { + "SpeechTranslationService": { + "clients": { + "grpc": { + "libraryClient": "SpeechTranslationServiceClient", + "rpcs": { + "StreamingTranslateSpeech": { + "methods": [ + "streamingTranslateSpeech" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SpeechTranslationServiceClient", + "rpcs": {} + } + } + } + } +} diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 730741dcbf2..172cff9a84d 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "c0245c54d8c45f1f3171e9066bc7bab3c4162b69" + "sha": "9a1b3e3c49e2a2cd6301d71b44051577c69d879b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2f019bf70bfe06f1e2af1b04011b0a2405190e43", - "internalRef": "343202295" + "sha": "d189e871205fea665a9648f7c4676f027495ccaf", + "internalRef": "345596855" } }, { From 8e1c30a010d0bbab2a2975994d9be3a82e6d6a45 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 22 Dec 2020 11:46:15 -0800 Subject: [PATCH 071/147] docs: add instructions for authenticating for system tests (#101) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/28ef5920-505e-44eb-bad6-0e53fa99adef/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/363fe305e9ce34a6cd53951c6ee5f997094b54ee --- .../google-cloud-mediatranslation/CONTRIBUTING.md | 15 +++++++++++++-- packages/google-cloud-mediatranslation/README.md | 3 +-- .../google-cloud-mediatranslation/synth.metadata | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CONTRIBUTING.md b/packages/google-cloud-mediatranslation/CONTRIBUTING.md index f6c4cf010e3..856e22d1bc2 100644 --- a/packages/google-cloud-mediatranslation/CONTRIBUTING.md +++ b/packages/google-cloud-mediatranslation/CONTRIBUTING.md @@ -37,6 +37,15 @@ accept your pull requests. 1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. 1. Submit a pull request. +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Media Translation API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + ## Running the tests 1. [Prepare your environment for Node.js setup][setup]. @@ -51,11 +60,9 @@ accept your pull requests. npm test # Run sample integration tests. - gcloud auth application-default login npm run samples-test # Run all system tests. - gcloud auth application-default login npm run system-test 1. Lint (and maybe fix) any changes: @@ -63,3 +70,7 @@ accept your pull requests. npm run fix [setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=mediatranslation.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index eb3b46e0c87..12da00b0969 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -136,8 +136,7 @@ async function quickstart() { ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-media-translation/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-media-translation/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 172cff9a84d..9bc63287339 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "9a1b3e3c49e2a2cd6301d71b44051577c69d879b" + "sha": "e8ba40d3d4b48ff83644162f37a51b8802e43cf6" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" + "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" } } ], From e5887988da6962e95542646074a999f9a36c0019 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 7 Jan 2021 11:42:12 -0800 Subject: [PATCH 072/147] docs: update dates (#102) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/d365a9d3-f86e-4598-8272-bbf6b821e385/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-mediatranslation/.jsdoc.js | 4 ++-- packages/google-cloud-mediatranslation/protos/protos.d.ts | 2 +- packages/google-cloud-mediatranslation/protos/protos.js | 2 +- packages/google-cloud-mediatranslation/src/index.ts | 2 +- packages/google-cloud-mediatranslation/src/v1beta1/index.ts | 2 +- .../src/v1beta1/speech_translation_service_client.ts | 2 +- packages/google-cloud-mediatranslation/synth.metadata | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-mediatranslation/system-test/install.ts | 2 +- .../test/gapic_speech_translation_service_v1beta1.ts | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.jsdoc.js b/packages/google-cloud-mediatranslation/.jsdoc.js index 54cf7f15f1a..91c149de3ab 100644 --- a/packages/google-cloud-mediatranslation/.jsdoc.js +++ b/packages/google-cloud-mediatranslation/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2020 Google LLC', + copyright: 'Copyright 2021 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/media-translation', diff --git a/packages/google-cloud-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts index 0e1eb0ccfb1..216825d3e08 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.d.ts +++ b/packages/google-cloud-mediatranslation/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index e21e6894b8d..102570a4c45 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/src/index.ts b/packages/google-cloud-mediatranslation/src/index.ts index 59d0bd1cc40..97e69fa7974 100644 --- a/packages/google-cloud-mediatranslation/src/index.ts +++ b/packages/google-cloud-mediatranslation/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/index.ts b/packages/google-cloud-mediatranslation/src/v1beta1/index.ts index 2a0ce60a0cc..daf7739e887 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/index.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 7f04f6705e1..56706e19d8a 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 9bc63287339..631e2cef42d 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "e8ba40d3d4b48ff83644162f37a51b8802e43cf6" + "sha": "f6540bf572bbcf20ccf4d42910214159afcf2673" } }, { diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js index 69241f359d5..710f32b5ae4 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts index dbc5846cd73..7f3cb720b91 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/system-test/install.ts b/packages/google-cloud-mediatranslation/system-test/install.ts index 39d90f771de..d2d61c0396f 100644 --- a/packages/google-cloud-mediatranslation/system-test/install.ts +++ b/packages/google-cloud-mediatranslation/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts index 7f97daaa044..01c9ec235e7 100644 --- a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts +++ b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From b3d445c868773ff939ba9da75826f37de02d454b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 Jan 2021 19:22:28 -0800 Subject: [PATCH 073/147] docs: update go link --- packages/google-cloud-mediatranslation/protos/protos.json | 2 +- packages/google-cloud-mediatranslation/synth.metadata | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/protos/protos.json b/packages/google-cloud-mediatranslation/protos/protos.json index afbceeb4d95..9f8cd770c86 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.json +++ b/packages/google-cloud-mediatranslation/protos/protos.json @@ -250,7 +250,7 @@ }, "protobuf": { "options": { - "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "go_package": "google.golang.org/protobuf/types/descriptorpb", "java_package": "com.google.protobuf", "java_outer_classname": "DescriptorProtos", "csharp_namespace": "Google.Protobuf.Reflection", diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 631e2cef42d..3b8d0aa45da 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "f6540bf572bbcf20ccf4d42910214159afcf2673" + "sha": "aa5703c92ae939953267b5e0f8d99d0914501171" } }, { From cff6b4d88773470f1088d9d7661559ca88c0a5fb Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 Jan 2021 08:44:17 -0800 Subject: [PATCH 074/147] refactor(nodejs): move build cop to flakybot (#105) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/79ba0372-ded2-4df4-829f-0c53e04a7c6d/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/57c23fa5705499a4181095ced81f0ee0933b64f6 --- packages/google-cloud-mediatranslation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 3b8d0aa45da..24d080798d3 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "aa5703c92ae939953267b5e0f8d99d0914501171" + "sha": "a5e2650a1dff2a387c9a6d38ac5eac785577161b" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" + "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" } } ], From c9b3a893cd341c321b5d1ff2de6ccb247357a27e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Feb 2021 18:08:09 -0800 Subject: [PATCH 075/147] build: adds UNORDERED_LIST enum (#108) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/f20ba027-76a5-44ba-baa4-962e18a97819/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-mediatranslation/protos/protos.d.ts | 3 ++- packages/google-cloud-mediatranslation/protos/protos.js | 7 +++++++ packages/google-cloud-mediatranslation/protos/protos.json | 3 ++- packages/google-cloud-mediatranslation/synth.metadata | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts index 216825d3e08..1e36a67095e 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.d.ts +++ b/packages/google-cloud-mediatranslation/protos/protos.d.ts @@ -714,7 +714,8 @@ export namespace google { REQUIRED = 2, OUTPUT_ONLY = 3, INPUT_ONLY = 4, - IMMUTABLE = 5 + IMMUTABLE = 5, + UNORDERED_LIST = 6 } } diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index 102570a4c45..51edeb84f3d 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -1669,6 +1669,7 @@ * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value * @property {number} INPUT_ONLY=4 INPUT_ONLY value * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value */ api.FieldBehavior = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -1678,6 +1679,7 @@ values[valuesById[3] = "OUTPUT_ONLY"] = 3; values[valuesById[4] = "INPUT_ONLY"] = 4; values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; return values; })(); @@ -7125,6 +7127,7 @@ case 3: case 4: case 5: + case 6: break; } } @@ -7220,6 +7223,10 @@ case 5: message[".google.api.fieldBehavior"][i] = 5; break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; } } return message; diff --git a/packages/google-cloud-mediatranslation/protos/protos.json b/packages/google-cloud-mediatranslation/protos/protos.json index 9f8cd770c86..447e61f2196 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.json +++ b/packages/google-cloud-mediatranslation/protos/protos.json @@ -227,7 +227,8 @@ "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, - "IMMUTABLE": 5 + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 } }, "methodSignature": { diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 24d080798d3..55d2b485b20 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "a5e2650a1dff2a387c9a6d38ac5eac785577161b" + "sha": "5ac8583ee687ca2f7545a7af055a2196a1bf7c21" } }, { From c99cfb2a1fb086c6d06c39fef2e85143c0bcd819 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 1 Mar 2021 17:28:50 -0800 Subject: [PATCH 076/147] chore: release 2.2.3 (#109) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-mediatranslation/CHANGELOG.md | 7 +++++++ packages/google-cloud-mediatranslation/package.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index 743a39772d6..2d9d0c10a23 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.2.3](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.2.2...v2.2.3) (2021-02-04) + + +### Bug Fixes + +* Added check to see if stream has been destroyed before writing result… ([#107](https://www.github.com/googleapis/nodejs-media-translation/issues/107)) ([5922538](https://www.github.com/googleapis/nodejs-media-translation/commit/592253836803d0ee6002a6e4c4d8a48d219f5d92)) + ### [2.2.2](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.2.1...v2.2.2) (2020-11-25) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 89482e64057..6a7a264eb1f 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.2.2", + "version": "2.2.3", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 4253c36bfa5..028680f7a9f 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.2.2", + "@google-cloud/media-translation": "^2.2.3", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From 6805a8dbabc5a5f7b65ae730a0fd56d40ef3031e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 7 Mar 2021 09:00:03 -0800 Subject: [PATCH 077/147] build: update gapic-generator-typescript to v1.2.10. (#110) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/a27e585a-8362-450e-a458-6225be320237/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 361273630 Source-Link: https://github.com/googleapis/googleapis/commit/5477122b3e8037a1dc5bc920536158edbd151dc4 --- packages/google-cloud-mediatranslation/synth.metadata | 6 +++--- packages/google-cloud-mediatranslation/webpack.config.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata index 55d2b485b20..e3203f7850b 100644 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ b/packages/google-cloud-mediatranslation/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "5ac8583ee687ca2f7545a7af055a2196a1bf7c21" + "sha": "7a1d29182550fcd18876482d09ce57ea93aa421e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d189e871205fea665a9648f7c4676f027495ccaf", - "internalRef": "345596855" + "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", + "internalRef": "361273630" } }, { diff --git a/packages/google-cloud-mediatranslation/webpack.config.js b/packages/google-cloud-mediatranslation/webpack.config.js index 4d45979f371..01d5dd93920 100644 --- a/packages/google-cloud-mediatranslation/webpack.config.js +++ b/packages/google-cloud-mediatranslation/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 64e597036c258d2aac208c75c83886782012e7a4 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Thu, 18 Mar 2021 14:36:08 -0700 Subject: [PATCH 078/147] chore: migrate to owl bot (#111) --- .../.github/.OwlBot.yaml | 23 +++++++++++ .../.repo-metadata.json | 15 +++---- .../synth.metadata | 37 ------------------ .../google-cloud-mediatranslation/synth.py | 39 ------------------- 4 files changed, 31 insertions(+), 83 deletions(-) create mode 100644 packages/google-cloud-mediatranslation/.github/.OwlBot.yaml delete mode 100644 packages/google-cloud-mediatranslation/synth.metadata delete mode 100644 packages/google-cloud-mediatranslation/synth.py diff --git a/packages/google-cloud-mediatranslation/.github/.OwlBot.yaml b/packages/google-cloud-mediatranslation/.github/.OwlBot.yaml new file mode 100644 index 00000000000..8303eea26aa --- /dev/null +++ b/packages/google-cloud-mediatranslation/.github/.OwlBot.yaml @@ -0,0 +1,23 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/mediatranslation/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + diff --git a/packages/google-cloud-mediatranslation/.repo-metadata.json b/packages/google-cloud-mediatranslation/.repo-metadata.json index abd57bbd313..6aada247b8d 100644 --- a/packages/google-cloud-mediatranslation/.repo-metadata.json +++ b/packages/google-cloud-mediatranslation/.repo-metadata.json @@ -1,13 +1,14 @@ { - "name": "mediatranslation", - "name_pretty": "Cloud Media Translation", - "product_documentation": "https://cloud.google.com/translate/media/docs/", "client_documentation": "https://googleapis.dev/nodejs/mediatranslation/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559749", + "api_id": "mediatranslation.googleapis.com", + "distribution_name": "@google-cloud/media-translation", "release_level": "beta", + "default_version": "v1beta1", "language": "nodejs", + "name_pretty": "Cloud Media Translation", "repo": "googleapis/nodejs-media-translation", - "distribution_name": "@google-cloud/media-translation", - "api_id": "mediatranslation.googleapis.com", - "requires_billing": true + "product_documentation": "https://cloud.google.com/translate/media/docs/", + "requires_billing": true, + "name": "mediatranslation", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559749" } diff --git a/packages/google-cloud-mediatranslation/synth.metadata b/packages/google-cloud-mediatranslation/synth.metadata deleted file mode 100644 index e3203f7850b..00000000000 --- a/packages/google-cloud-mediatranslation/synth.metadata +++ /dev/null @@ -1,37 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-media-translation.git", - "sha": "7a1d29182550fcd18876482d09ce57ea93aa421e" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", - "internalRef": "361273630" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "mediatranslation", - "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "bazel" - } - } - ] -} \ No newline at end of file diff --git a/packages/google-cloud-mediatranslation/synth.py b/packages/google-cloud-mediatranslation/synth.py deleted file mode 100644 index 18a3c405014..00000000000 --- a/packages/google-cloud-mediatranslation/synth.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import synthtool.languages.node as node -import logging - -logging.basicConfig(level=logging.DEBUG) - -AUTOSYNTH_MULTIPLE_COMMITS = True - - -# run the gapic generator -gapic = gcp.GAPICBazel() -versions = ['v1beta1'] -name = 'mediatranslation' -for version in versions: - library = gapic.node_library(name, version) -s.copy(library, excludes=['linkinator.config.json', 'package.json', 'README.md']) - -# Copy common templates -common_templates = gcp.CommonTemplates() -templates = common_templates.node_library(source_location='build/src') -s.copy(templates, excludes=['linkinator.config.json']) - -node.postprocess_gapic_library() From 09b6fea210d9cf9f7425e08f92729d91d26bf6d7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Mar 2021 17:52:33 +0100 Subject: [PATCH 079/147] chore(deps): update dependency sinon to v10 (#117) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^9.0.1` -> `^10.0.0`](https://renovatebot.com/diffs/npm/sinon/9.2.4/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/compatibility-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/confidence-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v10.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1000--2021-03-22) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v9.2.4...v10.0.0) ================== - Upgrade nise to 4.1.0 - Use [@​sinonjs/eslint-config](https://togithub.com/sinonjs/eslint-config)[@​4](https://togithub.com/4) => Adopts ES2017 => Drops support for IE 11, Legacy Edge and legacy Safari
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 6a7a264eb1f..1b06bc9982f 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -44,7 +44,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^9.0.1", + "sinon": "^10.0.0", "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From 586c75dfa47af126076acca0785194cbd17fe46b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 30 Mar 2021 12:18:24 -0700 Subject: [PATCH 080/147] build: update .OwlBot.lock with new version of post-processor (#121) Co-authored-by: gcf-owl-bot[bot] <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-mediatranslation/src/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/src/index.ts b/packages/google-cloud-mediatranslation/src/index.ts index 97e69fa7974..944ba1007dc 100644 --- a/packages/google-cloud-mediatranslation/src/index.ts +++ b/packages/google-cloud-mediatranslation/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,13 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** import * as v1beta1 from './v1beta1'; + const SpeechTranslationServiceClient = v1beta1.SpeechTranslationServiceClient; type SpeechTranslationServiceClient = v1beta1.SpeechTranslationServiceClient; + export {v1beta1, SpeechTranslationServiceClient}; export default {v1beta1, SpeechTranslationServiceClient}; import * as protos from '../protos/protos'; From ab1d3bdc655113d3ec0a240bb06c5030c4655a98 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:10:24 +0200 Subject: [PATCH 081/147] chore(deps): update dependency @types/sinon to v10 (#126) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^9.0.0` -> `^10.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/9.0.11/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/compatibility-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/confidence-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 1b06bc9982f..729f6096e36 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -34,7 +34,7 @@ "devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^12.12.29", - "@types/sinon": "^9.0.0", + "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^2.0.0", "jsdoc": "^3.6.3", From 6512d6150db5f46dae93f51caf4a79b12e5b9afb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Apr 2021 00:58:09 +0200 Subject: [PATCH 082/147] chore(deps): update dependency ts-loader to v9 (#130) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/ts-loader/8.1.0/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/compatibility-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/confidence-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
TypeStrong/ts-loader ### [`v9.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v900) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v8.1.0...v9.0.0) Breaking changes: - minimum webpack version: 5 - minimum node version: 12 Changes: - [webpack 5 migration](https://togithub.com/TypeStrong/ts-loader/pull/1251) - thanks [@​johnnyreilly](https://togithub.com/johnnyreilly), [@​jonwallsten](https://togithub.com/jonwallsten), [@​sokra](https://togithub.com/sokra), [@​appzuka](https://togithub.com/appzuka), [@​alexander-akait](https://togithub.com/alexander-akait)
--- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 729f6096e36..821181a224d 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -45,7 +45,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^10.0.0", - "ts-loader": "^8.0.0", + "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", "webpack-cli": "^4.0.0", From 610acd5e795e016b37c34099e7cab6d7ad92bf0f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 28 Apr 2021 09:08:51 -0700 Subject: [PATCH 083/147] fix!: Remove unsupported fields: recognition_result and alternative_source_language_codes. docs: Add more comments for supported audio type (#131) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix!: Remove unsupported fields: recognition_result and alternative_source_language_codes. docs: Add more comments for supported audio type. PiperOrigin-RevId: 370757154 Source-Link: https://github.com/googleapis/googleapis/commit/1d163315aecf9d8a3b77eb9e1549a0b353103b32 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b31870b4bb86210f406d76c79e16df55279f6475 * 🦉 Updates from OwlBot Co-authored-by: Owl Bot --- .../v1beta1/media_translation.proto | 59 +++++++------ .../protos/protos.d.ts | 18 ---- .../protos/protos.js | 84 ------------------- .../protos/protos.json | 22 ----- 4 files changed, 33 insertions(+), 150 deletions(-) diff --git a/packages/google-cloud-mediatranslation/protos/google/cloud/mediatranslation/v1beta1/media_translation.proto b/packages/google-cloud-mediatranslation/protos/google/cloud/mediatranslation/v1beta1/media_translation.proto index 88eed82ab05..88c86d094ef 100644 --- a/packages/google-cloud-mediatranslation/protos/google/cloud/mediatranslation/v1beta1/media_translation.proto +++ b/packages/google-cloud-mediatranslation/protos/google/cloud/mediatranslation/v1beta1/media_translation.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -50,31 +50,52 @@ message TranslateSpeechConfig { // // Uncompressed 16-bit signed little-endian samples (Linear PCM). // + // - `flac` // + // `flac` (Free Lossless Audio Codec) is the recommended encoding + // because it is lossless--therefore recognition is not compromised--and + // requires only about half the bandwidth of `linear16`. + // + // - `mulaw` + // + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + // + // - `amr` + // + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + // + // - `amr-wb` + // + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + // + // - `ogg-opus` + // + // Opus encoded audio frames in [Ogg](https://wikipedia.org/wiki/Ogg) + // container. `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, + // or 48000. + // + // - `mp3` + // + // MP3 audio. Support all standard MP3 bitrates (which range from 32-320 + // kbps). When using this encoding, `sample_rate_hertz` has to match the + // sample rate of the file being used. string audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; // Required. Source language code (BCP-47) of the input audio. string source_language_code = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. A list of up to 3 additional language codes (BCP-47), listing possible - // alternative languages of the supplied audio. If alternative source - // languages are listed, speech translation result will translate in the most - // likely language detected including the main source_language_code. The - // translated result will include the language code of the language detected - // in the audio. - repeated string alternative_source_language_codes = 6 [(google.api.field_behavior) = OPTIONAL]; - // Required. Target language code (BCP-47) of the output. string target_language_code = 3 [(google.api.field_behavior) = REQUIRED]; // Optional. Sample rate in Hertz of the audio data. Valid values are: // 8000-48000. 16000 is optimal. For best results, set the sampling rate of // the audio source to 16000 Hz. If that's not possible, use the native sample - // rate of the audio source (instead of re-sampling). This field can only be - // omitted for `FLAC` and `WAV` audio files. + // rate of the audio source (instead of re-sampling). int32 sample_rate_hertz = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. + // Optional. `google-provided-model/video` and + // `google-provided-model/enhanced-phone-call` are premium models. + // `google-provided-model/phone-call` is not premium model. string model = 5 [(google.api.field_behavior) = OPTIONAL]; } @@ -140,27 +161,13 @@ message StreamingTranslateSpeechResult { // return any further hypotheses for this portion of the transcript and // corresponding audio. bool is_final = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The source language code (BCP-47) detected in the audio. Speech - // translation result will translate in the most likely language detected - // including the alternative source languages and main source_language_code. - string detected_source_language_code = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Translation result. - // - // Use oneof field to reserve for future tts result. oneof result { // Text translation result. TextTranslationResult text_translation_result = 1; } - - // Output only. The debug only recognition result in original language. This field is debug - // only and will be set to empty string if not available. - // This is implementation detail and will not be backward compatible. - // - // Still need to decide whether to expose this field by default. - string recognition_result = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // A streaming speech translation response corresponding to a portion of diff --git a/packages/google-cloud-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts index 1e36a67095e..bd209802812 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.d.ts +++ b/packages/google-cloud-mediatranslation/protos/protos.d.ts @@ -80,9 +80,6 @@ export namespace google { /** TranslateSpeechConfig sourceLanguageCode */ sourceLanguageCode?: (string|null); - /** TranslateSpeechConfig alternativeSourceLanguageCodes */ - alternativeSourceLanguageCodes?: (string[]|null); - /** TranslateSpeechConfig targetLanguageCode */ targetLanguageCode?: (string|null); @@ -108,9 +105,6 @@ export namespace google { /** TranslateSpeechConfig sourceLanguageCode. */ public sourceLanguageCode: string; - /** TranslateSpeechConfig alternativeSourceLanguageCodes. */ - public alternativeSourceLanguageCodes: string[]; - /** TranslateSpeechConfig targetLanguageCode. */ public targetLanguageCode: string; @@ -391,9 +385,6 @@ export namespace google { /** StreamingTranslateSpeechResult textTranslationResult */ textTranslationResult?: (google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult|null); - - /** StreamingTranslateSpeechResult recognitionResult */ - recognitionResult?: (string|null); } /** Represents a StreamingTranslateSpeechResult. */ @@ -408,9 +399,6 @@ export namespace google { /** StreamingTranslateSpeechResult textTranslationResult. */ public textTranslationResult?: (google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult|null); - /** StreamingTranslateSpeechResult recognitionResult. */ - public recognitionResult: string; - /** StreamingTranslateSpeechResult result. */ public result?: "textTranslationResult"; @@ -495,9 +483,6 @@ export namespace google { /** TextTranslationResult isFinal */ isFinal?: (boolean|null); - - /** TextTranslationResult detectedSourceLanguageCode */ - detectedSourceLanguageCode?: (string|null); } /** Represents a TextTranslationResult. */ @@ -515,9 +500,6 @@ export namespace google { /** TextTranslationResult isFinal. */ public isFinal: boolean; - /** TextTranslationResult detectedSourceLanguageCode. */ - public detectedSourceLanguageCode: string; - /** * Creates a new TextTranslationResult instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index 51edeb84f3d..75d96073bdb 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -142,7 +142,6 @@ * @interface ITranslateSpeechConfig * @property {string|null} [audioEncoding] TranslateSpeechConfig audioEncoding * @property {string|null} [sourceLanguageCode] TranslateSpeechConfig sourceLanguageCode - * @property {Array.|null} [alternativeSourceLanguageCodes] TranslateSpeechConfig alternativeSourceLanguageCodes * @property {string|null} [targetLanguageCode] TranslateSpeechConfig targetLanguageCode * @property {number|null} [sampleRateHertz] TranslateSpeechConfig sampleRateHertz * @property {string|null} [model] TranslateSpeechConfig model @@ -157,7 +156,6 @@ * @param {google.cloud.mediatranslation.v1beta1.ITranslateSpeechConfig=} [properties] Properties to set */ function TranslateSpeechConfig(properties) { - this.alternativeSourceLanguageCodes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -180,14 +178,6 @@ */ TranslateSpeechConfig.prototype.sourceLanguageCode = ""; - /** - * TranslateSpeechConfig alternativeSourceLanguageCodes. - * @member {Array.} alternativeSourceLanguageCodes - * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig - * @instance - */ - TranslateSpeechConfig.prototype.alternativeSourceLanguageCodes = $util.emptyArray; - /** * TranslateSpeechConfig targetLanguageCode. * @member {string} targetLanguageCode @@ -246,9 +236,6 @@ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.sampleRateHertz); if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.model); - if (message.alternativeSourceLanguageCodes != null && message.alternativeSourceLanguageCodes.length) - for (var i = 0; i < message.alternativeSourceLanguageCodes.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.alternativeSourceLanguageCodes[i]); return writer; }; @@ -289,11 +276,6 @@ case 2: message.sourceLanguageCode = reader.string(); break; - case 6: - if (!(message.alternativeSourceLanguageCodes && message.alternativeSourceLanguageCodes.length)) - message.alternativeSourceLanguageCodes = []; - message.alternativeSourceLanguageCodes.push(reader.string()); - break; case 3: message.targetLanguageCode = reader.string(); break; @@ -344,13 +326,6 @@ if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) if (!$util.isString(message.sourceLanguageCode)) return "sourceLanguageCode: string expected"; - if (message.alternativeSourceLanguageCodes != null && message.hasOwnProperty("alternativeSourceLanguageCodes")) { - if (!Array.isArray(message.alternativeSourceLanguageCodes)) - return "alternativeSourceLanguageCodes: array expected"; - for (var i = 0; i < message.alternativeSourceLanguageCodes.length; ++i) - if (!$util.isString(message.alternativeSourceLanguageCodes[i])) - return "alternativeSourceLanguageCodes: string[] expected"; - } if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) if (!$util.isString(message.targetLanguageCode)) return "targetLanguageCode: string expected"; @@ -379,13 +354,6 @@ message.audioEncoding = String(object.audioEncoding); if (object.sourceLanguageCode != null) message.sourceLanguageCode = String(object.sourceLanguageCode); - if (object.alternativeSourceLanguageCodes) { - if (!Array.isArray(object.alternativeSourceLanguageCodes)) - throw TypeError(".google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.alternativeSourceLanguageCodes: array expected"); - message.alternativeSourceLanguageCodes = []; - for (var i = 0; i < object.alternativeSourceLanguageCodes.length; ++i) - message.alternativeSourceLanguageCodes[i] = String(object.alternativeSourceLanguageCodes[i]); - } if (object.targetLanguageCode != null) message.targetLanguageCode = String(object.targetLanguageCode); if (object.sampleRateHertz != null) @@ -408,8 +376,6 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.alternativeSourceLanguageCodes = []; if (options.defaults) { object.audioEncoding = ""; object.sourceLanguageCode = ""; @@ -427,11 +393,6 @@ object.sampleRateHertz = message.sampleRateHertz; if (message.model != null && message.hasOwnProperty("model")) object.model = message.model; - if (message.alternativeSourceLanguageCodes && message.alternativeSourceLanguageCodes.length) { - object.alternativeSourceLanguageCodes = []; - for (var j = 0; j < message.alternativeSourceLanguageCodes.length; ++j) - object.alternativeSourceLanguageCodes[j] = message.alternativeSourceLanguageCodes[j]; - } return object; }; @@ -913,7 +874,6 @@ * @memberof google.cloud.mediatranslation.v1beta1 * @interface IStreamingTranslateSpeechResult * @property {google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.ITextTranslationResult|null} [textTranslationResult] StreamingTranslateSpeechResult textTranslationResult - * @property {string|null} [recognitionResult] StreamingTranslateSpeechResult recognitionResult */ /** @@ -939,14 +899,6 @@ */ StreamingTranslateSpeechResult.prototype.textTranslationResult = null; - /** - * StreamingTranslateSpeechResult recognitionResult. - * @member {string} recognitionResult - * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult - * @instance - */ - StreamingTranslateSpeechResult.prototype.recognitionResult = ""; - // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -987,8 +939,6 @@ writer = $Writer.create(); if (message.textTranslationResult != null && Object.hasOwnProperty.call(message, "textTranslationResult")) $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.encode(message.textTranslationResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.recognitionResult); return writer; }; @@ -1026,9 +976,6 @@ case 1: message.textTranslationResult = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.decode(reader, reader.uint32()); break; - case 3: - message.recognitionResult = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -1073,9 +1020,6 @@ return "textTranslationResult." + error; } } - if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) - if (!$util.isString(message.recognitionResult)) - return "recognitionResult: string expected"; return null; }; @@ -1096,8 +1040,6 @@ throw TypeError(".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.textTranslationResult: object expected"); message.textTranslationResult = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.fromObject(object.textTranslationResult); } - if (object.recognitionResult != null) - message.recognitionResult = String(object.recognitionResult); return message; }; @@ -1114,15 +1056,11 @@ if (!options) options = {}; var object = {}; - if (options.defaults) - object.recognitionResult = ""; if (message.textTranslationResult != null && message.hasOwnProperty("textTranslationResult")) { object.textTranslationResult = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.toObject(message.textTranslationResult, options); if (options.oneofs) object.result = "textTranslationResult"; } - if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) - object.recognitionResult = message.recognitionResult; return object; }; @@ -1145,7 +1083,6 @@ * @interface ITextTranslationResult * @property {string|null} [translation] TextTranslationResult translation * @property {boolean|null} [isFinal] TextTranslationResult isFinal - * @property {string|null} [detectedSourceLanguageCode] TextTranslationResult detectedSourceLanguageCode */ /** @@ -1179,14 +1116,6 @@ */ TextTranslationResult.prototype.isFinal = false; - /** - * TextTranslationResult detectedSourceLanguageCode. - * @member {string} detectedSourceLanguageCode - * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult - * @instance - */ - TextTranslationResult.prototype.detectedSourceLanguageCode = ""; - /** * Creates a new TextTranslationResult instance using the specified properties. * @function create @@ -1215,8 +1144,6 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.translation); if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isFinal); - if (message.detectedSourceLanguageCode != null && Object.hasOwnProperty.call(message, "detectedSourceLanguageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.detectedSourceLanguageCode); return writer; }; @@ -1257,9 +1184,6 @@ case 2: message.isFinal = reader.bool(); break; - case 3: - message.detectedSourceLanguageCode = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -1301,9 +1225,6 @@ if (message.isFinal != null && message.hasOwnProperty("isFinal")) if (typeof message.isFinal !== "boolean") return "isFinal: boolean expected"; - if (message.detectedSourceLanguageCode != null && message.hasOwnProperty("detectedSourceLanguageCode")) - if (!$util.isString(message.detectedSourceLanguageCode)) - return "detectedSourceLanguageCode: string expected"; return null; }; @@ -1323,8 +1244,6 @@ message.translation = String(object.translation); if (object.isFinal != null) message.isFinal = Boolean(object.isFinal); - if (object.detectedSourceLanguageCode != null) - message.detectedSourceLanguageCode = String(object.detectedSourceLanguageCode); return message; }; @@ -1344,14 +1263,11 @@ if (options.defaults) { object.translation = ""; object.isFinal = false; - object.detectedSourceLanguageCode = ""; } if (message.translation != null && message.hasOwnProperty("translation")) object.translation = message.translation; if (message.isFinal != null && message.hasOwnProperty("isFinal")) object.isFinal = message.isFinal; - if (message.detectedSourceLanguageCode != null && message.hasOwnProperty("detectedSourceLanguageCode")) - object.detectedSourceLanguageCode = message.detectedSourceLanguageCode; return object; }; diff --git a/packages/google-cloud-mediatranslation/protos/protos.json b/packages/google-cloud-mediatranslation/protos/protos.json index 447e61f2196..e2083aa1959 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.json +++ b/packages/google-cloud-mediatranslation/protos/protos.json @@ -48,14 +48,6 @@ "(google.api.field_behavior)": "REQUIRED" } }, - "alternativeSourceLanguageCodes": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, "targetLanguageCode": { "type": "string", "id": 3, @@ -129,13 +121,6 @@ "textTranslationResult": { "type": "TextTranslationResult", "id": 1 - }, - "recognitionResult": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } } }, "nested": { @@ -154,13 +139,6 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } - }, - "detectedSourceLanguageCode": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } } } } From fc0b87c7d84c26fbc9b75e14868586962ff10d30 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 May 2021 17:52:26 -0700 Subject: [PATCH 084/147] fix(deps): require google-gax v2.12.0 (#139) --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 821181a224d..1422f200024 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -29,7 +29,7 @@ "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { - "google-gax": "^2.9.2" + "google-gax": "^2.12.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From e2bd352281874cf490c6f1b8198e828fe15117b4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 17:00:07 +0000 Subject: [PATCH 085/147] chore: new owl bot post processor docker image (#140) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../protos/protos.d.ts | 2 +- .../protos/protos.js | 4 +- .../speech_translation_service_client.ts | 15 +-- .../system-test/fixtures/sample/src/index.js | 3 +- ...apic_speech_translation_service_v1beta1.ts | 114 +++++++++--------- 5 files changed, 72 insertions(+), 66 deletions(-) diff --git a/packages/google-cloud-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts index bd209802812..58fee865116 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.d.ts +++ b/packages/google-cloud-mediatranslation/protos/protos.d.ts @@ -304,7 +304,7 @@ export namespace google { public streamingConfig?: (google.cloud.mediatranslation.v1beta1.IStreamingTranslateSpeechConfig|null); /** StreamingTranslateSpeechRequest audioContent. */ - public audioContent: (Uint8Array|string); + public audioContent?: (Uint8Array|string|null); /** StreamingTranslateSpeechRequest streamingRequest. */ public streamingRequest?: ("streamingConfig"|"audioContent"); diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index 75d96073bdb..05dfdf1593b 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -660,11 +660,11 @@ /** * StreamingTranslateSpeechRequest audioContent. - * @member {Uint8Array} audioContent + * @member {Uint8Array|null|undefined} audioContent * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest * @instance */ - StreamingTranslateSpeechRequest.prototype.audioContent = $util.newBuffer([]); + StreamingTranslateSpeechRequest.prototype.audioContent = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 56706e19d8a..64001b43251 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -210,13 +210,14 @@ export class SpeechTranslationServiceClient { const speechTranslationServiceStubMethods = ['streamingTranslateSpeech']; for (const methodName of speechTranslationServiceStubMethods) { const callPromise = this.speechTranslationServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js index 710f32b5ae4..b4e18d0e9fa 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js @@ -20,7 +20,8 @@ const mediatranslation = require('@google-cloud/media-translation'); function main() { - const speechTranslationServiceClient = new mediatranslation.SpeechTranslationServiceClient(); + const speechTranslationServiceClient = + new mediatranslation.SpeechTranslationServiceClient(); } main(); diff --git a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts index 01c9ec235e7..1bfded386f2 100644 --- a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts +++ b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -75,49 +74,54 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { }); it('should create a client with no option', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient(); + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - fallback: true, - } - ); + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + fallback: true, + } + ); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); assert.strictEqual(client.speechTranslationServiceStub, undefined); await client.initialize(); assert(client.speechTranslationServiceStub); }); it('has close method', () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + 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); @@ -126,12 +130,13 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -150,12 +155,13 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { describe('streamingTranslateSpeech', () => { it('invokes streamingTranslateSpeech without error', async () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest() @@ -163,9 +169,8 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse() ); - client.innerApiCalls.streamingTranslateSpeech = stubBidiStreamingCall( - expectedResponse - ); + client.innerApiCalls.streamingTranslateSpeech = + stubBidiStreamingCall(expectedResponse); const stream = client.streamingTranslateSpeech(); const promise = new Promise((resolve, reject) => { stream.on( @@ -190,20 +195,20 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { .calledWithExactly(undefined) ); assert.deepStrictEqual( - (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( - 0 - ).args[0], + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], request ); }); it('invokes streamingTranslateSpeech with error', async () => { - const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest() @@ -236,9 +241,8 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { .calledWithExactly(undefined) ); assert.deepStrictEqual( - (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( - 0 - ).args[0], + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], request ); }); From 720915b64c01bae5d667ba604327021aadddad38 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 21:58:02 +0000 Subject: [PATCH 086/147] fix: use require() to load JSON protos (#141) The library is regenerated with gapic-generator-typescript v1.3.1. Committer: @alexander-fenster PiperOrigin-RevId: 372468161 Source-Link: https://github.com/googleapis/googleapis/commit/75880c3e6a6aa2597400582848e81bbbfac51dea Source-Link: https://github.com/googleapis/googleapis-gen/commit/77b18044813d4c8c415ff9ea68e76e307eb8e904 --- .../speech_translation_service_client.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 64001b43251..dd688cecafe 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -22,6 +22,7 @@ import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1beta1/speech_translation_service_client_config.json`. @@ -136,22 +137,7 @@ export class SpeechTranslationServiceClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // Some of the methods on this service provide streaming responses. // Provide descriptors for these. From 45f95bb4d977add82c89a50f19f1c52c476d6606 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 23:12:33 +0000 Subject: [PATCH 087/147] chore: update gapic-generator-typescript to v1.3.2 (#142) Committer: @alexander-fenster PiperOrigin-RevId: 372656503 Source-Link: https://github.com/googleapis/googleapis/commit/6fa858c6489b1bbc505a7d7afe39f2dc45819c38 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d7c95df3ab1ea1b4c22a4542bad4924cc46d1388 --- .../src/v1beta1/speech_translation_service_client.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index dd688cecafe..9aec2fc83c3 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -19,7 +19,6 @@ /* global window */ import * as gax from 'google-gax'; import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; -import * as path from 'path'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); From c89b57960c1e252944cbbc9c9fb3e81137b293ee Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 May 2021 19:04:21 +0200 Subject: [PATCH 088/147] chore(deps): update dependency @types/node to v14 (#145) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^12.12.29` -> `^14.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/12.20.13/14.17.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/compatibility-slim/12.20.13)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/confidence-slim/12.20.13)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 1422f200024..a0e7faeb60f 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^12.12.29", + "@types/node": "^14.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^2.0.0", From 19dd3a2c6a600547accfc9ba9c4f2bb11ed68ace Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 17:56:33 +0200 Subject: [PATCH 089/147] chore(deps): update dependency sinon to v11 (#146) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^10.0.0` -> `^11.0.0`](https://renovatebot.com/diffs/npm/sinon/10.0.0/11.1.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v11.1.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1110--2021-05-25) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.0.0...31be9a5d5a4762ef01cb195f29024616dfee9ce8) \================== - Add sinon.promise() implementation ([#​2369](https://togithub.com/sinonjs/sinon/issues/2369)) - Set wrappedMethod on getters/setters ([#​2378](https://togithub.com/sinonjs/sinon/issues/2378)) - \[Docs] Update fake-server usage & descriptions ([#​2365](https://togithub.com/sinonjs/sinon/issues/2365)) - Fake docs improvement ([#​2360](https://togithub.com/sinonjs/sinon/issues/2360)) - Update nise to 5.1.0 (fixed [#​2318](https://togithub.com/sinonjs/sinon/issues/2318)) ### [`v11.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1100--2021-05-24) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.1...v11.0.0) \================== - Explicitly use samsam 6.0.2 with fix for [#​2345](https://togithub.com/sinonjs/sinon/issues/2345) - Update most packages ([#​2371](https://togithub.com/sinonjs/sinon/issues/2371)) - Update compatibility docs ([#​2366](https://togithub.com/sinonjs/sinon/issues/2366)) - Update packages (includes breaking fake-timers change, see [#​2352](https://togithub.com/sinonjs/sinon/issues/2352)) - Warn of potential memory leaks ([#​2357](https://togithub.com/sinonjs/sinon/issues/2357)) - Fix clock test errors ### [`v10.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1001--2021-04-08) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.0...v10.0.1) \================== - Upgrade sinon components (bumps y18n to 4.0.1) - Bump y18n from 4.0.0 to 4.0.1
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index a0e7faeb60f..94cebcaca9d 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -44,7 +44,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^10.0.0", + "sinon": "^11.0.0", "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From eaed8079d26b4a83f0b701440f9143b8ecda42b6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 25 May 2021 20:48:39 +0000 Subject: [PATCH 090/147] fix: GoogleAdsError missing using generator version after 1.3.0 (#147) [PR](https://github.com/googleapis/gapic-generator-typescript/pull/878) within updated gapic-generator-typescript version 1.4.0 Committer: @summer-ji-eng PiperOrigin-RevId: 375759421 Source-Link: https://github.com/googleapis/googleapis/commit/95fa72fdd0d69b02d72c33b37d1e4cc66d4b1446 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f40a34377ad488a7c2bc3992b3c8d5faf5a15c46 --- .../src/v1beta1/speech_translation_service_client.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 9aec2fc83c3..a3bd333579c 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -131,6 +131,8 @@ export class SpeechTranslationServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); From 7854447717d6299f1d5703fc55aaf941d4026013 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 10 Jun 2021 23:04:24 +0200 Subject: [PATCH 091/147] chore(nodejs): remove api-extractor dependencies (#152) --- packages/google-cloud-mediatranslation/package.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 94cebcaca9d..788240a4a80 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -24,9 +24,7 @@ "lint": "gts check", "prelint": "cd samples; npm link ../; npm install", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "precompile": "gts clean", - "api-extractor": "api-extractor run --local", - "api-documenter": "api-documenter yaml --input-folder=temp" + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.12.0" @@ -48,9 +46,7 @@ "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", - "webpack-cli": "^4.0.0", - "@microsoft/api-documenter": "^7.8.10", - "@microsoft/api-extractor": "^7.8.10" + "webpack-cli": "^4.0.0" }, "engines": { "node": ">=10" From 3f377ca4a7f9dbd7a62139cebf5f1b550b592339 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Tue, 22 Jun 2021 11:21:09 -0700 Subject: [PATCH 092/147] samples: another typo in comments (#155) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: another typo in comments * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-mediatranslation/README.md | 2 +- packages/google-cloud-mediatranslation/samples/quickstart.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index 12da00b0969..db39fd1891e 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -75,7 +75,7 @@ async function quickstart() { // const filename = 'Local path to audio file, e.g. /path/to/audio.raw'; // const encoding = 'Encoding of the audio file, e.g. LINEAR16'; // const sourceLanguage = 'BCP-47 source language code, e.g. en-US'; - // const targetLangauge = 'BCP-47 target language code, e.g. es-ES'; + // const targetLanguage = 'BCP-47 target language code, e.g. es-ES'; const config = { audioConfig: { diff --git a/packages/google-cloud-mediatranslation/samples/quickstart.js b/packages/google-cloud-mediatranslation/samples/quickstart.js index 6d32bdc92eb..1232e4fdaa9 100644 --- a/packages/google-cloud-mediatranslation/samples/quickstart.js +++ b/packages/google-cloud-mediatranslation/samples/quickstart.js @@ -39,7 +39,7 @@ function main(filename, encoding, sourceLanguage, targetLanguage) { // const filename = 'Local path to audio file, e.g. /path/to/audio.raw'; // const encoding = 'Encoding of the audio file, e.g. LINEAR16'; // const sourceLanguage = 'BCP-47 source language code, e.g. en-US'; - // const targetLangauge = 'BCP-47 target language code, e.g. es-ES'; + // const targetLanguage = 'BCP-47 target language code, e.g. es-ES'; const config = { audioConfig: { From 13269131285f71aec590de799057cf494aca8a05 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 25 Jun 2021 09:20:55 -0700 Subject: [PATCH 093/147] chore: release 2.3.0 (#159) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .../google-cloud-mediatranslation/CHANGELOG.md | 15 +++++++++++++++ .../google-cloud-mediatranslation/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index 2d9d0c10a23..54137474429 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.3.0](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.2.3...v2.3.0) (2021-06-25) + + +### ⚠ BREAKING CHANGES + +* Remove unsupported fields: recognition_result and alternative_source_language_codes. docs: Add more comments for supported audio type (#131) + +### Bug Fixes + +* **build:** next version should be 2.3.0 ([#158](https://www.github.com/googleapis/nodejs-media-translation/issues/158)) ([1d4f7a0](https://www.github.com/googleapis/nodejs-media-translation/commit/1d4f7a00e3a88ab1581c5e690cad40074738cefb)) +* **deps:** require google-gax v2.12.0 ([#139](https://www.github.com/googleapis/nodejs-media-translation/issues/139)) ([bda81f9](https://www.github.com/googleapis/nodejs-media-translation/commit/bda81f920df258677ae4b24b647ee4c17a0ccbef)) +* GoogleAdsError missing using generator version after 1.3.0 ([#147](https://www.github.com/googleapis/nodejs-media-translation/issues/147)) ([735843a](https://www.github.com/googleapis/nodejs-media-translation/commit/735843a9bbeb84be9f61a718271bcd81860a5eaa)) +* Remove unsupported fields: recognition_result and alternative_source_language_codes. docs: Add more comments for supported audio type ([#131](https://www.github.com/googleapis/nodejs-media-translation/issues/131)) ([cfaeb1c](https://www.github.com/googleapis/nodejs-media-translation/commit/cfaeb1ce0699eaa372d1ed726bd445177dafe546)) +* use require() to load JSON protos ([#141](https://www.github.com/googleapis/nodejs-media-translation/issues/141)) ([1bc887c](https://www.github.com/googleapis/nodejs-media-translation/commit/1bc887cb22014d066e2c382a7f8cf7f518ec903d)) + ### [2.2.3](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.2.2...v2.2.3) (2021-02-04) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 788240a4a80..708e19dc710 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.2.3", + "version": "2.3.0", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 028680f7a9f..80bad208f88 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.2.3", + "@google-cloud/media-translation": "^2.3.0", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From aa5f2b76e370335d87304c8ddeafc1c91f85a4c2 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 30 Jun 2021 12:16:34 -0400 Subject: [PATCH 094/147] fix(deps): google-gax v2.17.0 with mTLS (#161) --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 708e19dc710..0fa042c524e 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^2.17.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From 0f2bb3b771f7970a13b264f794e652f946f3febc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 30 Jun 2021 16:28:27 +0000 Subject: [PATCH 095/147] chore: release 2.3.1 (#163) :robot: I have created a release \*beep\* \*boop\* --- ### [2.3.1](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.0...v2.3.1) (2021-06-30) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#161](https://www.github.com/googleapis/nodejs-media-translation/issues/161)) ([bbd1415](https://www.github.com/googleapis/nodejs-media-translation/commit/bbd141565364bc0bbb15f1240d98683033da3001)) --- 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-mediatranslation/CHANGELOG.md | 7 +++++++ packages/google-cloud-mediatranslation/package.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index 54137474429..ed469d0d878 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.3.1](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.0...v2.3.1) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#161](https://www.github.com/googleapis/nodejs-media-translation/issues/161)) ([bbd1415](https://www.github.com/googleapis/nodejs-media-translation/commit/bbd141565364bc0bbb15f1240d98683033da3001)) + ## [2.3.0](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.2.3...v2.3.0) (2021-06-25) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 0fa042c524e..b2a29b7ff26 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.3.0", + "version": "2.3.1", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 80bad208f88..1e08b6247e7 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.3.0", + "@google-cloud/media-translation": "^2.3.1", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From b19aee6464995a8f8a227f50a4ff8f6a55819cd5 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 18:34:26 -0400 Subject: [PATCH 096/147] fix(deps): google-gax v2.17.1 (#164) --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index b2a29b7ff26..19c028ad502 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.17.0" + "google-gax": "^2.17.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 51fca15ac6e1d368ea6420dbdd491d494274f3f4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 23:00:53 +0000 Subject: [PATCH 097/147] chore: release 2.3.2 (#165) :robot: I have created a release \*beep\* \*boop\* --- ### [2.3.2](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.1...v2.3.2) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#164](https://www.github.com/googleapis/nodejs-media-translation/issues/164)) ([6c7caad](https://www.github.com/googleapis/nodejs-media-translation/commit/6c7caadc989cfe0e898ce2034d2fbac71208d888)) --- 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-mediatranslation/CHANGELOG.md | 7 +++++++ packages/google-cloud-mediatranslation/package.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index ed469d0d878..d17cea8824b 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.3.2](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.1...v2.3.2) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#164](https://www.github.com/googleapis/nodejs-media-translation/issues/164)) ([6c7caad](https://www.github.com/googleapis/nodejs-media-translation/commit/6c7caadc989cfe0e898ce2034d2fbac71208d888)) + ### [2.3.1](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.0...v2.3.1) (2021-06-30) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 19c028ad502..5ee98400b59 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.3.1", + "version": "2.3.2", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 1e08b6247e7..b9fe45b7623 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.3.1", + "@google-cloud/media-translation": "^2.3.2", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From 0614ede8af77f95e819649f6199548209fd71296 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 19:08:46 +0000 Subject: [PATCH 098/147] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#166) Also removing the explicit generator tag for the IAMPolicy mixin for the kms and pubsub APIS as the generator will now read it from the .yaml file. PiperOrigin-RevId: 385101839 Source-Link: https://github.com/googleapis/googleapis/commit/80f404215a9346259db760d80d0671f28c433453 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d3509d2520fb8db862129633f1cf8406d17454e1 --- .../src/v1beta1/speech_translation_service_client.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index a3bd333579c..774e8b6ba57 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -39,6 +39,7 @@ const version = require('../../../package.json').version; export class SpeechTranslationServiceClient { 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: {}; @@ -50,6 +51,7 @@ export class SpeechTranslationServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; speechTranslationServiceStub?: Promise<{[name: string]: Function}>; @@ -93,6 +95,9 @@ export class SpeechTranslationServiceClient { .constructor as typeof SpeechTranslationServiceClient; 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 = @@ -160,6 +165,9 @@ export class SpeechTranslationServiceClient { // 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; } /** @@ -189,7 +197,8 @@ export class SpeechTranslationServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.mediatranslation.v1beta1 .SpeechTranslationService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From 13ff0b2347e32f1eca1060e28bb15ad525f69a9d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 00:32:15 +0000 Subject: [PATCH 099/147] chore: release 2.3.3 (#167) :robot: I have created a release \*beep\* \*boop\* --- ### [2.3.3](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.2...v2.3.3) (2021-07-21) ### Bug Fixes * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#166](https://www.github.com/googleapis/nodejs-media-translation/issues/166)) ([a1899d2](https://www.github.com/googleapis/nodejs-media-translation/commit/a1899d2f2f7bfa0894c0b1823ce75759638ff91b)) --- 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-mediatranslation/CHANGELOG.md | 7 +++++++ packages/google-cloud-mediatranslation/package.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index d17cea8824b..12882508a4f 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.3.3](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.2...v2.3.3) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#166](https://www.github.com/googleapis/nodejs-media-translation/issues/166)) ([a1899d2](https://www.github.com/googleapis/nodejs-media-translation/commit/a1899d2f2f7bfa0894c0b1823ce75759638ff91b)) + ### [2.3.2](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.1...v2.3.2) (2021-07-12) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 5ee98400b59..bc610bd6e28 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.3.2", + "version": "2.3.3", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index b9fe45b7623..e8285d56468 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.3.2", + "@google-cloud/media-translation": "^2.3.3", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From bb54906b82421c37df6a68239bd20f6da537dcd3 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:00:45 -0400 Subject: [PATCH 100/147] chore(nodejs): update client ref docs link in metadata (#172) --- packages/google-cloud-mediatranslation/.repo-metadata.json | 2 +- packages/google-cloud-mediatranslation/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.repo-metadata.json b/packages/google-cloud-mediatranslation/.repo-metadata.json index 6aada247b8d..4fa306f5da4 100644 --- a/packages/google-cloud-mediatranslation/.repo-metadata.json +++ b/packages/google-cloud-mediatranslation/.repo-metadata.json @@ -1,5 +1,5 @@ { - "client_documentation": "https://googleapis.dev/nodejs/mediatranslation/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/media-translation/latest", "api_id": "mediatranslation.googleapis.com", "distribution_name": "@google-cloud/media-translation", "release_level": "beta", diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index db39fd1891e..9bb7c63aa81 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -204,7 +204,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-media-translation/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/mediatranslation/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/media-translation/latest [product-docs]: https://cloud.google.com/translate/media/docs/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 59cbf093f94316b0d37124161215a89eafd89fc2 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 16 Aug 2021 22:46:22 -0400 Subject: [PATCH 101/147] fix(deps): google-gax v2.24.1 (#174) --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index bc610bd6e28..422d5f06cd4 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.17.1" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From da709f4d6b388a4e04e9be534f351a557a399403 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 03:26:38 +0000 Subject: [PATCH 102/147] chore: release 2.3.4 (#175) :robot: I have created a release \*beep\* \*boop\* --- ### [2.3.4](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.3...v2.3.4) (2021-08-17) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#174](https://www.github.com/googleapis/nodejs-media-translation/issues/174)) ([b90cf10](https://www.github.com/googleapis/nodejs-media-translation/commit/b90cf1034235ab0416011de7a1b77afed5597dfc)) --- 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-mediatranslation/CHANGELOG.md | 7 +++++++ packages/google-cloud-mediatranslation/package.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index 12882508a4f..66e0003daae 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.3.4](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.3...v2.3.4) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#174](https://www.github.com/googleapis/nodejs-media-translation/issues/174)) ([b90cf10](https://www.github.com/googleapis/nodejs-media-translation/commit/b90cf1034235ab0416011de7a1b77afed5597dfc)) + ### [2.3.3](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.2...v2.3.3) (2021-07-21) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 422d5f06cd4..1c44b5a9913 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.3.3", + "version": "2.3.4", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index e8285d56468..e714fd35ad4 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.3.3", + "@google-cloud/media-translation": "^2.3.4", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From d1b9226f32d6a519486e6826c417c8d6f627423f 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:17 +0000 Subject: [PATCH 103/147] feat: turns on self-signed JWT feature flag (#176) - [ ] 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/v1beta1/speech_translation_service_client.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 774e8b6ba57..9cacdc33a8a 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -122,6 +122,12 @@ export class SpeechTranslationServiceClient { // 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 b6c0e033d43763e6ef04084e73574138a9be8ac4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 23:35:44 +0000 Subject: [PATCH 104/147] chore: disable renovate dependency dashboard (#1194) (#179) --- packages/google-cloud-mediatranslation/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index 9bb7c63aa81..49cf4716c1a 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -195,8 +195,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 dce37721a144f632e15f4d199e0c3a1cdf8befda Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 8 Sep 2021 11:08:20 -0400 Subject: [PATCH 105/147] fix(build): update branch to main (#180) --- packages/google-cloud-mediatranslation/README.md | 16 ++++++++-------- .../samples/README.md | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index 49cf4716c1a..67e8564a663 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/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/media-translation.svg)](https://www.npmjs.org/package/@google-cloud/media-translation) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-media-translation/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-media-translation) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-media-translation/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-media-translation) @@ -15,7 +15,7 @@ Mediatranslation client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-media-translation/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-media-translation/blob/main/CHANGELOG.md). * [Cloud Media Translation Node.js Client API Reference][client-docs] * [Cloud Media Translation Documentation][product-docs] @@ -136,13 +136,13 @@ async function quickstart() { ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-media-translation/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-media-translation/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-media-translation/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-media-translation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Translate_from_file | [source code](https://github.com/googleapis/nodejs-media-translation/blob/master/samples/translate_from_file.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_file.js,samples/README.md) | -| Translate_from_mic | [source code](https://github.com/googleapis/nodejs-media-translation/blob/master/samples/translate_from_mic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_mic.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-media-translation/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-media-translation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Translate_from_file | [source code](https://github.com/googleapis/nodejs-media-translation/blob/main/samples/translate_from_file.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_file.js,samples/README.md) | +| Translate_from_mic | [source code](https://github.com/googleapis/nodejs-media-translation/blob/main/samples/translate_from_mic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_mic.js,samples/README.md) | @@ -190,7 +190,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-media-translation/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-media-translation/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`) @@ -202,7 +202,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-media-translation/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-media-translation/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/media-translation/latest [product-docs]: https://cloud.google.com/translate/media/docs/ diff --git a/packages/google-cloud-mediatranslation/samples/README.md b/packages/google-cloud-mediatranslation/samples/README.md index 2d998a2e11d..f27abf4ec83 100644 --- a/packages/google-cloud-mediatranslation/samples/README.md +++ b/packages/google-cloud-mediatranslation/samples/README.md @@ -33,7 +33,7 @@ Before running the samples, make sure you've followed the steps outlined in ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-media-translation/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-media-translation/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-media-translation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) @@ -50,7 +50,7 @@ __Usage:__ ### Translate_from_file -View the [source code](https://github.com/googleapis/nodejs-media-translation/blob/master/samples/translate_from_file.js). +View the [source code](https://github.com/googleapis/nodejs-media-translation/blob/main/samples/translate_from_file.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_file.js,samples/README.md) @@ -67,7 +67,7 @@ __Usage:__ ### Translate_from_mic -View the [source code](https://github.com/googleapis/nodejs-media-translation/blob/master/samples/translate_from_mic.js). +View the [source code](https://github.com/googleapis/nodejs-media-translation/blob/main/samples/translate_from_mic.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_mic.js,samples/README.md) From bef941c050aeeb9033544d3d05d6db36882c92a4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 8 Sep 2021 08:08:43 -0700 Subject: [PATCH 106/147] chore: release 2.4.0 (#177) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: release 2.4.0 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot 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-mediatranslation/CHANGELOG.md | 7 +++++++ packages/google-cloud-mediatranslation/package.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index 66e0003daae..b6ff47539f1 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.4.0](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.4...v2.4.0) (2021-09-08) + + +### Features + +* turns on self-signed JWT feature flag ([#176](https://www.github.com/googleapis/nodejs-media-translation/issues/176)) ([26a0d2e](https://www.github.com/googleapis/nodejs-media-translation/commit/26a0d2e7b39176ad27dcfe076c70fc5c90be5159)) + ### [2.3.4](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.3...v2.3.4) (2021-08-17) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 1c44b5a9913..b6b0f7d68bc 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.3.4", + "version": "2.4.0", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index e714fd35ad4..ad10a4d34c2 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.3.4", + "@google-cloud/media-translation": "^2.4.0", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From 6586c16fd7c7eb80399e70c360ffefbe73cec0b7 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:28 +0000 Subject: [PATCH 107/147] build(node): update deps used during postprocessing (#1243) (#187) --- .../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-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts index 58fee865116..531151db24e 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.d.ts +++ b/packages/google-cloud-mediatranslation/protos/protos.d.ts @@ -697,7 +697,8 @@ export namespace google { OUTPUT_ONLY = 3, INPUT_ONLY = 4, IMMUTABLE = 5, - UNORDERED_LIST = 6 + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 } } diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index 05dfdf1593b..e65adc76ec3 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -1586,6 +1586,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); @@ -1596,6 +1597,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; })(); @@ -7044,6 +7046,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -7143,6 +7146,10 @@ case 6: message[".google.api.fieldBehavior"][i] = 6; break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; } } return message; diff --git a/packages/google-cloud-mediatranslation/protos/protos.json b/packages/google-cloud-mediatranslation/protos/protos.json index e2083aa1959..367a5a13107 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.json +++ b/packages/google-cloud-mediatranslation/protos/protos.json @@ -206,7 +206,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "methodSignature": { @@ -788,6 +789,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From ee96fb55a2f6d47f9802da059bbbe9c1642739a2 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 27 Oct 2021 06:32:22 -0700 Subject: [PATCH 108/147] chore: fix the wrong post processor image (#189) --- packages/google-cloud-mediatranslation/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/.github/.OwlBot.yaml b/packages/google-cloud-mediatranslation/.github/.OwlBot.yaml index 8303eea26aa..01169fa832f 100644 --- a/packages/google-cloud-mediatranslation/.github/.OwlBot.yaml +++ b/packages/google-cloud-mediatranslation/.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 ce08754f122b3c6e9692b451f7f752642ce77c3f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Oct 2021 17:32:31 +0200 Subject: [PATCH 109/147] chore(deps): update dependency @types/node to v16 (#188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^14.0.0` -> `^16.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/14.17.32/16.11.6) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/compatibility-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/confidence-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index b6b0f7d68bc..b8fc9bbf608 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^14.0.0", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^2.0.0", From bbd13e150d391f8d5ec3a0e435fb4efa660ff622 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 4 Nov 2021 11:50:33 -0400 Subject: [PATCH 110/147] chore(cloud-rad): delete api-extractor config (#191) --- .../api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-mediatranslation/api-extractor.json diff --git a/packages/google-cloud-mediatranslation/api-extractor.json b/packages/google-cloud-mediatranslation/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-mediatranslation/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 271a86844b29618d0b16c1e82a1aa5f7ef8f5a83 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:46:20 +0100 Subject: [PATCH 111/147] chore(deps): update dependency sinon to v12 (#190) 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-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index b8fc9bbf608..e8b889aedae 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -42,7 +42,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^11.0.0", + "sinon": "^12.0.0", "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From a57a073e0321f622f56ee5499ce1a432c39ff507 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 10 Nov 2021 21:34:27 +0000 Subject: [PATCH 112/147] docs(samples): add example tags to generated samples (#192) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 408439482 Source-Link: https://github.com/googleapis/googleapis/commit/b9f61843dc80c7c285fc34fd3a40aae55082c2b9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9 --- .../linkinator.config.json | 2 +- ...tion_service.streaming_translate_speech.js | 74 +++++++++++++++++++ .../speech_translation_service_client.ts | 8 +- 3 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js diff --git a/packages/google-cloud-mediatranslation/linkinator.config.json b/packages/google-cloud-mediatranslation/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-mediatranslation/linkinator.config.json +++ b/packages/google-cloud-mediatranslation/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js new file mode 100644 index 00000000000..b7c76da7d64 --- /dev/null +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js @@ -0,0 +1,74 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main() { + // [START mediatranslation_v1beta1_generated_SpeechTranslationService_StreamingTranslateSpeech_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Provides information to the recognizer that specifies how to process the + * request. The first `StreamingTranslateSpeechRequest` message must contain + * a `streaming_config` message. + */ + // const streamingConfig = {} + /** + * The audio data to be translated. Sequential chunks of audio data are sent + * in sequential `StreamingTranslateSpeechRequest` messages. The first + * `StreamingTranslateSpeechRequest` message must not contain + * `audio_content` data and all subsequent `StreamingTranslateSpeechRequest` + * messages must contain `audio_content` data. The audio bytes must be + * encoded as specified in `StreamingTranslateSpeechConfig`. Note: as with + * all bytes fields, protobuffers use a pure binary representation (not + * base64). + */ + // const audioContent = 'Buffer.from('string')' + + // Imports the Mediatranslation library + const {SpeechTranslationServiceClient} = + require('@google-cloud/media-translation').v1beta1; + + // Instantiates a client + const mediatranslationClient = new SpeechTranslationServiceClient(); + + async function callStreamingTranslateSpeech() { + // Construct request + const request = {}; + + // Run request + const stream = await mediatranslationClient.streamingTranslateSpeech(); + stream.on('data', response => { + console.log(response); + }); + stream.on('error', err => { + throw err; + }); + stream.on('end', () => { + /* API call completed */ + }); + stream.write(request); + stream.end(); + } + + callStreamingTranslateSpeech(); + // [END mediatranslation_v1beta1_generated_SpeechTranslationService_StreamingTranslateSpeech_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 9cacdc33a8a..10413093a67 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -305,12 +305,8 @@ export class SpeechTranslationServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) * for more details and examples. - * @example - * const stream = client.streamingTranslateSpeech(); - * stream.on('data', (response) => { ... }); - * stream.on('end', () => { ... }); - * stream.write(request); - * stream.end(); + * @example include:samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js + * region_tag:mediatranslation_v1beta1_generated_SpeechTranslationService_StreamingTranslateSpeech_async */ streamingTranslateSpeech(options?: CallOptions): gax.CancellableStream { this.initialize(); From ec5358a8bba220cd559d7768082af45b13cc5566 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 9 Dec 2021 22:46:13 +0000 Subject: [PATCH 113/147] build: add generated samples to .eslintignore (#193) --- packages/google-cloud-mediatranslation/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-mediatranslation/.eslintignore b/packages/google-cloud-mediatranslation/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-mediatranslation/.eslintignore +++ b/packages/google-cloud-mediatranslation/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From 8053d42e46361a95bd969f8952e55f66686ef16c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Dec 2021 19:58:22 +0000 Subject: [PATCH 114/147] docs(node): support "stable"/"preview" release level (#1312) (#196) --- packages/google-cloud-mediatranslation/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index 67e8564a663..768e63d0af4 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -176,6 +176,7 @@ 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 @@ -184,6 +185,7 @@ 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 From aba747d4d959a58ffd95f4d479e44204c29f2835 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 23:12:32 +0000 Subject: [PATCH 115/147] docs(badges): tweak badge to use new preview/stable language (#1314) (#197) --- packages/google-cloud-mediatranslation/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index 768e63d0af4..d9c35bd9cb4 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -6,7 +6,6 @@ [![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/media-translation.svg)](https://www.npmjs.org/package/@google-cloud/media-translation) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-media-translation/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-media-translation) From d38a5e4ce6bee60ee12ec5119c1fa573bf7eb580 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:08:34 +0000 Subject: [PATCH 116/147] test(nodejs): remove 15 add 16 (#1322) (#199) --- packages/google-cloud-mediatranslation/protos/protos.d.ts | 2 +- packages/google-cloud-mediatranslation/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts index 531151db24e..b4669a322ac 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.d.ts +++ b/packages/google-cloud-mediatranslation/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-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index e65adc76ec3..39bc8bef6c3 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/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 b4c10a1b87a760ba82b205acd2429fa83675156a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 12 Jan 2022 18:08:28 +0100 Subject: [PATCH 117/147] chore(deps): update dependency gts to v3 (#200) 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 | |---|---|---|---|---|---| | [gts](https://togithub.com/google/gts) | [`^2.0.0` -> `^3.0.0`](https://renovatebot.com/diffs/npm/gts/2.0.2/3.1.0) | [![age](https://badges.renovateapi.com/packages/npm/gts/3.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/gts/3.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/gts/3.1.0/compatibility-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/gts/3.1.0/confidence-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
google/gts ### [`v3.1.0`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​310-httpswwwgithubcomgooglegtscomparev303v310-2021-01-11) [Compare Source](https://togithub.com/google/gts/compare/v3.0.3...v3.1.0) ##### Features - support comments in JSON ([#​571](https://www.togithub.com/google/gts/issues/571)) ([cb6d2ca](https://www.github.com/google/gts/commit/cb6d2cacb5de7bcc9c8e82dd47e14fc5bf9596a3)) ##### Bug Fixes - **deps:** update dependency eslint-config-prettier to v7 ([#​601](https://www.togithub.com/google/gts/issues/601)) ([6e26681](https://www.github.com/google/gts/commit/6e266812da4b90b18e2abead9b2b5a1ca0c6654b)) - **deps:** upgrade to latest version of meow ([#​616](https://www.togithub.com/google/gts/issues/616)) ([634bad9](https://www.github.com/google/gts/commit/634bad9bbbdb4d397bba101dc38ab14881172a30)) ##### [3.0.3](https://www.github.com/google/gts/compare/v3.0.2...v3.0.3) (2020-12-03) ##### Bug Fixes - **deps:** update dependency execa to v5 ([#​600](https://www.togithub.com/google/gts/issues/600)) ([4e5f1e5](https://www.github.com/google/gts/commit/4e5f1e54facf53588bbb3b025b5240edbd7f3c8a)) - **deps:** update dependency meow to v8 ([#​591](https://www.togithub.com/google/gts/issues/591)) ([c7e223e](https://www.github.com/google/gts/commit/c7e223e6a2ff605fabad2f8359a0385033f8de66)) ##### [3.0.2](https://www.github.com/google/gts/compare/v3.0.1...v3.0.2) (2020-10-26) ##### Bug Fixes - **deps:** loosen ts peer dependency ([#​589](https://www.togithub.com/google/gts/issues/589)) ([8f1d381](https://www.github.com/google/gts/commit/8f1d381d7b166a510c42786c4a337e81b7222c84)) ##### [3.0.1](https://www.github.com/google/gts/compare/v3.0.0...v3.0.1) (2020-10-12) ##### Bug Fixes - **rule:** turn off [@​typescript-eslint/no-var-requires](https://togithub.com/typescript-eslint/no-var-requires) ([#​578](https://www.togithub.com/google/gts/issues/578)) ([3b37229](https://www.github.com/google/gts/commit/3b37229c45969a3c53af123c69bb749578ee6b0b)) ### [`v3.0.3`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​303-httpswwwgithubcomgooglegtscomparev302v303-2020-12-03) [Compare Source](https://togithub.com/google/gts/compare/v3.0.2...v3.0.3) ### [`v3.0.2`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​302-httpswwwgithubcomgooglegtscomparev301v302-2020-10-26) [Compare Source](https://togithub.com/google/gts/compare/v3.0.1...v3.0.2) ### [`v3.0.1`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​301-httpswwwgithubcomgooglegtscomparev300v301-2020-10-12) [Compare Source](https://togithub.com/google/gts/compare/v3.0.0...v3.0.1) ### [`v3.0.0`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​300-httpswwwgithubcomgooglegtscomparev202v300-2020-10-08) [Compare Source](https://togithub.com/google/gts/compare/v2.0.2...v3.0.0) ##### ⚠ BREAKING CHANGES - change default `check` to `lint` ([#​570](https://togithub.com/google/gts/issues/570)) - **deps:** require TypeScript 4.x ([#​565](https://togithub.com/google/gts/issues/565)) ##### Features - Add TypeScript v4 support ([#​551](https://www.togithub.com/google/gts/issues/551)) ([0883956](https://www.github.com/google/gts/commit/08839565a1d2b4b39d532c9b0b596f01b18856fe)) - change default `check` to `lint` ([#​570](https://www.togithub.com/google/gts/issues/570)) ([c527b66](https://www.github.com/google/gts/commit/c527b66be1ef6a78ea14b3d29225a8d7fb7097bd)) - generate .eslintignore when running init ([#​521](https://www.togithub.com/google/gts/issues/521)) ([8bce036](https://www.github.com/google/gts/commit/8bce0368767f0c2ad7d0700deb839962bc928d16)) ##### Bug Fixes - add build/.eslintrc.json to files field ([#​553](https://www.togithub.com/google/gts/issues/553)) ([3b516ad](https://www.github.com/google/gts/commit/3b516ad5e9f0d58201dde469461db7c6ed1c1b78)) - **deps:** require TypeScript 4.x ([#​565](https://www.togithub.com/google/gts/issues/565)) ([cbc5267](https://www.github.com/google/gts/commit/cbc5267579ef24e8c8ceaa2ef794df3ef54ea56a)) - **deps:** update dependency update-notifier to v5 ([#​574](https://www.togithub.com/google/gts/issues/574)) ([9a882bf](https://www.github.com/google/gts/commit/9a882bf4ac30ad06e7b91a65ad5721d8e8b41c4b)) - **deps:** update typescript-eslint monorepo to v2.34.0 ([#​509](https://www.togithub.com/google/gts/issues/509)) ([998a4ac](https://www.github.com/google/gts/commit/998a4ac9b75c97f04d8e5db37563f32d31652f23)) - **deps:** update typescript-eslint monorepo to v3 (major) ([#​528](https://www.togithub.com/google/gts/issues/528)) ([e22e173](https://www.github.com/google/gts/commit/e22e17338db2ddb7eb829c821037c2f4e77ff869)) - **deps:** update typescript-eslint monorepo to v4 ([#​556](https://www.togithub.com/google/gts/issues/556)) ([54148df](https://www.github.com/google/gts/commit/54148dfbd8b5f8b36a0f44f901c5db933393a661)) - better error message for broken tsconfig.json ([#​501](https://www.togithub.com/google/gts/issues/501)) ([0c17a76](https://www.github.com/google/gts/commit/0c17a76c6650eee1d8abaff11a897a432eeaa65f)) - prohibit calls for it.only and describe.only ([#​499](https://www.togithub.com/google/gts/issues/499)) ([071c33c](https://www.github.com/google/gts/commit/071c33ceef0e3765166aaebf6ed4698167ac0f98)) ##### [2.0.2](https://www.github.com/google/gts/compare/v2.0.1...v2.0.2) (2020-05-11) ##### Bug Fixes - Revert 'update dependency eslint to v7'" ([#​507](https://www.togithub.com/google/gts/issues/507)) ([0f9950b](https://www.github.com/google/gts/commit/0f9950b273329dbcce5f3cc20864c3dcd076f08c)) - **deps:** pin release of eslint-typescript ([#​508](https://www.togithub.com/google/gts/issues/508)) ([bd86b42](https://www.github.com/google/gts/commit/bd86b42e2bb904d3765dee82262e4691a11b9958)) - **deps:** update dependency eslint to v7 ([#​504](https://www.togithub.com/google/gts/issues/504)) ([6aee159](https://www.github.com/google/gts/commit/6aee1595d0486ae2c7fd68d16b1b59c4c4015753)) ##### [2.0.1](https://www.github.com/google/gts/compare/v2.0.0...v2.0.1) (2020-05-07) ##### Bug Fixes - throw an error if running with an unsupported version of nodejs ([#​493](https://www.togithub.com/google/gts/issues/493)) ([94fdf1e](https://www.github.com/google/gts/commit/94fdf1eaed634aa73c3e44c7a3d9f1325f773b07)) - **deps:** update dependency meow to v7 ([#​502](https://www.togithub.com/google/gts/issues/502)) ([cf91cda](https://www.github.com/google/gts/commit/cf91cda1afab25759427511d3c97d0037d61c649))
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **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-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index e8b889aedae..9631f36a849 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -34,7 +34,7 @@ "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", - "gts": "^2.0.0", + "gts": "^3.0.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", From b8dfcc29af491c65af2ccf1c2a0a00ec11f3c237 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 26 Jan 2022 19:52:58 +0000 Subject: [PATCH 118/147] chore: update v2.12.0 gapic-generator-typescript (#205) - [ ] 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 --- .../google-cloud-mediatranslation/.jsdoc.js | 4 ++-- .../linkinator.config.json | 10 +++++++-- ...tion_service.streaming_translate_speech.js | 21 +++++++------------ .../src/v1beta1/index.ts | 2 +- .../speech_translation_service_client.ts | 4 ++-- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- ...apic_speech_translation_service_v1beta1.ts | 6 +++--- 9 files changed, 27 insertions(+), 26 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.jsdoc.js b/packages/google-cloud-mediatranslation/.jsdoc.js index 91c149de3ab..5e14a19535a 100644 --- a/packages/google-cloud-mediatranslation/.jsdoc.js +++ b/packages/google-cloud-mediatranslation/.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/media-translation', diff --git a/packages/google-cloud-mediatranslation/linkinator.config.json b/packages/google-cloud-mediatranslation/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-mediatranslation/linkinator.config.json +++ b/packages/google-cloud-mediatranslation/linkinator.config.json @@ -3,8 +3,14 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" ], "silent": true, - "concurrency": 5 + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 } diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js index b7c76da7d64..34a6224d429 100644 --- a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main() { @@ -38,29 +39,23 @@ function main() { // const audioContent = 'Buffer.from('string')' // Imports the Mediatranslation library - const {SpeechTranslationServiceClient} = - require('@google-cloud/media-translation').v1beta1; + const {SpeechTranslationServiceClient} = require('@google-cloud/media-translation').v1beta1; // Instantiates a client const mediatranslationClient = new SpeechTranslationServiceClient(); async function callStreamingTranslateSpeech() { // Construct request - const request = {}; + const request = { + }; // Run request const stream = await mediatranslationClient.streamingTranslateSpeech(); - stream.on('data', response => { - console.log(response); - }); - stream.on('error', err => { - throw err; - }); - stream.on('end', () => { - /* API call completed */ - }); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); stream.write(request); - stream.end(); + stream.end(); } callStreamingTranslateSpeech(); diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/index.ts b/packages/google-cloud-mediatranslation/src/v1beta1/index.ts index daf7739e887..ed24eb00326 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/index.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 10413093a67..0e01159fbb6 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_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. @@ -310,7 +310,7 @@ export class SpeechTranslationServiceClient { */ streamingTranslateSpeech(options?: CallOptions): gax.CancellableStream { this.initialize(); - return this.innerApiCalls.streamingTranslateSpeech(options); + return this.innerApiCalls.streamingTranslateSpeech(null, options); } /** diff --git a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js index b4e18d0e9fa..912e8a64d7d 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-mediatranslation/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-mediatranslation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts index 7f3cb720b91..1b52e5d0a92 100644 --- a/packages/google-cloud-mediatranslation/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-mediatranslation/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-mediatranslation/system-test/install.ts b/packages/google-cloud-mediatranslation/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-mediatranslation/system-test/install.ts +++ b/packages/google-cloud-mediatranslation/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-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts index 1bfded386f2..6e3082f8092 100644 --- a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts +++ b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -192,7 +192,7 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { assert( (client.innerApiCalls.streamingTranslateSpeech as SinonStub) .getCall(0) - .calledWithExactly(undefined) + .calledWith(null) ); assert.deepStrictEqual( ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) @@ -238,7 +238,7 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { assert( (client.innerApiCalls.streamingTranslateSpeech as SinonStub) .getCall(0) - .calledWithExactly(undefined) + .calledWith(null) ); assert.deepStrictEqual( ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) From 590d67f8bc5744fede5d50cbcf684864a3503f47 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 31 Jan 2022 23:30:46 +0100 Subject: [PATCH 119/147] chore(deps): update dependency sinon to v13 (#207) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^12.0.0` -> `^13.0.0`](https://renovatebot.com/diffs/npm/sinon/12.0.1/13.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/compatibility-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/confidence-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v13.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1300) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.1...v13.0.0) - [`cf3d6c0c`](https://togithub.com/sinonjs/sinon/commit/cf3d6c0cd9689c0ee673b3daa8bf9abd70304392) Upgrade packages ([#​2431](https://togithub.com/sinonjs/sinon/issues/2431)) (Carl-Erik Kopseng) > - Update all @​sinonjs/ packages > > - Upgrade to fake-timers 9 > > - chore: ensure always using latest LTS release - [`41710467`](https://togithub.com/sinonjs/sinon/commit/417104670d575e96a1b645ea40ce763afa76fb1b) Adjust deploy scripts to archive old releases in a separate branch, move existing releases out of master ([#​2426](https://togithub.com/sinonjs/sinon/issues/2426)) (Joel Bradshaw) > Co-authored-by: Carl-Erik Kopseng - [`c80a7266`](https://togithub.com/sinonjs/sinon/commit/c80a72660e89d88b08275eff1028ecb9e26fd8e9) Bump node-fetch from 2.6.1 to 2.6.7 ([#​2430](https://togithub.com/sinonjs/sinon/issues/2430)) (dependabot\[bot]) > Co-authored-by: dependabot\[bot] <49699333+dependabot\[bot][@​users](https://togithub.com/users).noreply.github.com> - [`a00f14a9`](https://togithub.com/sinonjs/sinon/commit/a00f14a97dbe8c65afa89674e16ad73fc7d2fdc0) Add explicit export for `./*` ([#​2413](https://togithub.com/sinonjs/sinon/issues/2413)) (なつき) - [`b82ca7ad`](https://togithub.com/sinonjs/sinon/commit/b82ca7ad9b1add59007771f65a18ee34415de8ca) Bump cached-path-relative from 1.0.2 to 1.1.0 ([#​2428](https://togithub.com/sinonjs/sinon/issues/2428)) (dependabot\[bot]) - [`a9ea1427`](https://togithub.com/sinonjs/sinon/commit/a9ea142716c094ef3c432ecc4089f8207b8dd8b6) Add documentation for assert.calledOnceWithMatch ([#​2424](https://togithub.com/sinonjs/sinon/issues/2424)) (Mathias Schreck) - [`1d5ab86b`](https://togithub.com/sinonjs/sinon/commit/1d5ab86ba60e50dd69593ffed2bffd4b8faa0d38) Be more general in stripping off stack frames to fix Firefox tests ([#​2425](https://togithub.com/sinonjs/sinon/issues/2425)) (Joel Bradshaw) - [`56b06129`](https://togithub.com/sinonjs/sinon/commit/56b06129e223eae690265c37b1113067e2b31bdc) Check call count type ([#​2410](https://togithub.com/sinonjs/sinon/issues/2410)) (Joel Bradshaw) - [`7863e2df`](https://togithub.com/sinonjs/sinon/commit/7863e2dfdbda79e0a32e42af09e6539fc2f2b80f) Fix [#​2414](https://togithub.com/sinonjs/sinon/issues/2414): make Sinon available on homepage (Carl-Erik Kopseng) - [`fabaabdd`](https://togithub.com/sinonjs/sinon/commit/fabaabdda82f39a7f5b75b55bd56cf77b1cd4a8f) Bump nokogiri from 1.11.4 to 1.13.1 ([#​2423](https://togithub.com/sinonjs/sinon/issues/2423)) (dependabot\[bot]) - [`dbc0fbd2`](https://togithub.com/sinonjs/sinon/commit/dbc0fbd263c8419fa47f9c3b20cf47890a242d21) Bump shelljs from 0.8.4 to 0.8.5 ([#​2422](https://togithub.com/sinonjs/sinon/issues/2422)) (dependabot\[bot]) - [`fb8b3d72`](https://togithub.com/sinonjs/sinon/commit/fb8b3d72a85dc8fb0547f859baf3f03a22a039f7) Run Prettier (Carl-Erik Kopseng) - [`12a45939`](https://togithub.com/sinonjs/sinon/commit/12a45939e9b047b6d3663fe55f2eb383ec63c4e1) Fix 2377: Throw error when trying to stub non-configurable or non-writable properties ([#​2417](https://togithub.com/sinonjs/sinon/issues/2417)) (Stuart Dotson) > Fixes issue [#​2377](https://togithub.com/sinonjs/sinon/issues/2377) by throwing an error when trying to stub non-configurable or non-writable properties *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2022-01-28.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 9631f36a849..4b7a294412d 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -42,7 +42,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^12.0.0", + "sinon": "^13.0.0", "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From 0c2bb65fc57ff301f4e35bb614cec97be6684d4a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 4 Feb 2022 16:09:02 +0000 Subject: [PATCH 120/147] docs(nodejs): version support policy edits (#1346) (#209) --- .../google-cloud-mediatranslation/README.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index d9c35bd9cb4..362e36580fc 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -153,21 +153,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/media-translation@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From 584f077d5b23045093bd9521600226368ccaba99 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 02:05:07 +0000 Subject: [PATCH 121/147] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#210) - [ ] 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 --- ...google.cloud.mediatranslation.v1beta1.json | 59 +++++++++++++++++++ ...tion_service.streaming_translate_speech.js | 9 ++- .../speech_translation_service_client.ts | 26 ++++++-- ...apic_speech_translation_service_v1beta1.ts | 22 ++++++- 4 files changed, 107 insertions(+), 9 deletions(-) create mode 100644 packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json new file mode 100644 index 00000000000..9c764e9f2c1 --- /dev/null +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json @@ -0,0 +1,59 @@ +{ + "clientLibrary": { + "name": "nodejs-mediatranslation", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.mediatranslation.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "mediatranslation_v1beta1_generated_SpeechTranslationService_StreamingTranslateSpeech_async", + "title": "SpeechTranslationService streamingTranslateSpeech Sample", + "origin": "API_DEFINITION", + "description": " Performs bidirectional streaming speech translation: receive results while sending audio. This method is only available via the gRPC API (not REST).", + "canonical": true, + "file": "speech_translation_service.streaming_translate_speech.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamingTranslateSpeech", + "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationService.StreamingTranslateSpeech", + "async": true, + "parameters": [ + { + "name": "streaming_config", + "type": ".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig" + }, + { + "name": "audio_content", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse", + "client": { + "shortName": "SpeechTranslationServiceClient", + "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationServiceClient" + }, + "method": { + "shortName": "StreamingTranslateSpeech", + "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationService.StreamingTranslateSpeech", + "service": { + "shortName": "SpeechTranslationService", + "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js index 34a6224d429..feaebce89e8 100644 --- a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.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-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 0e01159fbb6..9a73eb9d56c 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -18,8 +18,15 @@ /* global window */ import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; - +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GoogleError, +} from 'google-gax'; + +import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -215,6 +222,16 @@ export class SpeechTranslationServiceClient { stub => (...args: Array<{}>) => { if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough(); + setImmediate(() => { + stream.emit( + 'error', + new GoogleError('The client has already been closed.') + ); + }); + return stream; + } return Promise.reject('The client has already been closed.'); } const func = stub[methodName]; @@ -320,9 +337,8 @@ export class SpeechTranslationServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.speechTranslationServiceStub!.then(stub => { + if (this.speechTranslationServiceStub && !this._terminated) { + return this.speechTranslationServiceStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts index 6e3082f8092..a703fa613bc 100644 --- a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts +++ b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts @@ -102,7 +102,7 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { assert(client.speechTranslationServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( { @@ -110,7 +110,25 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { projectId: 'bogus', } ); - client.close(); + client.initialize(); + assert(client.speechTranslationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.speechTranslationServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { From f9b580b00cdfe18ef87c4d937f4ec93e85ab5e42 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 28 Feb 2022 18:54:18 -0500 Subject: [PATCH 122/147] chore: add api_shortname and library_type to repo metadata (#195) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update .repo-metadata.json * chore: update library_type in repo-metadata.json * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com> Co-authored-by: nicain --- .../google-cloud-mediatranslation/.repo-metadata.json | 6 ++++-- packages/google-cloud-mediatranslation/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.repo-metadata.json b/packages/google-cloud-mediatranslation/.repo-metadata.json index 4fa306f5da4..37bc757c2a8 100644 --- a/packages/google-cloud-mediatranslation/.repo-metadata.json +++ b/packages/google-cloud-mediatranslation/.repo-metadata.json @@ -2,7 +2,7 @@ "client_documentation": "https://cloud.google.com/nodejs/docs/reference/media-translation/latest", "api_id": "mediatranslation.googleapis.com", "distribution_name": "@google-cloud/media-translation", - "release_level": "beta", + "release_level": "preview", "default_version": "v1beta1", "language": "nodejs", "name_pretty": "Cloud Media Translation", @@ -10,5 +10,7 @@ "product_documentation": "https://cloud.google.com/translate/media/docs/", "requires_billing": true, "name": "mediatranslation", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559749" + "issue_tracker": "https://issuetracker.google.com/savedsearches/559749", + "api_shortname": "mediatranslation", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index 362e36580fc..c46aaaaf6e0 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -4,7 +4,7 @@ # [Cloud Media Translation: Node.js Client](https://github.com/googleapis/nodejs-media-translation) -[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/media-translation.svg)](https://www.npmjs.org/package/@google-cloud/media-translation) @@ -176,13 +176,12 @@ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be in **beta**. This means it is expected to be -mostly stable while we work toward a general availability release; however, -complete stability is not guaranteed. We will address issues and requests -against beta libraries with a high priority. +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. More Information: [Google Cloud Platform Launch Stages][launch_stages] From 5870d347308a1aeda1f06a3fb2b2272665a355cc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 02:34:37 +0000 Subject: [PATCH 123/147] build(node): update client library version in samples metadata (#1356) (#220) * 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 --- ...google.cloud.mediatranslation.v1beta1.json | 112 +++++++++--------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json index 9c764e9f2c1..2ee8660c455 100644 --- a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json @@ -1,59 +1,59 @@ { - "clientLibrary": { - "name": "nodejs-mediatranslation", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.mediatranslation.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "mediatranslation_v1beta1_generated_SpeechTranslationService_StreamingTranslateSpeech_async", - "title": "SpeechTranslationService streamingTranslateSpeech Sample", - "origin": "API_DEFINITION", - "description": " Performs bidirectional streaming speech translation: receive results while sending audio. This method is only available via the gRPC API (not REST).", - "canonical": true, - "file": "speech_translation_service.streaming_translate_speech.js", - "language": "JAVASCRIPT", - "segments": [ + "clientLibrary": { + "name": "nodejs-mediatranslation", + "version": "2.4.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.mediatranslation.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StreamingTranslateSpeech", - "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationService.StreamingTranslateSpeech", - "async": true, - "parameters": [ - { - "name": "streaming_config", - "type": ".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig" - }, - { - "name": "audio_content", - "type": "TYPE_BYTES" - } - ], - "resultType": ".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse", - "client": { - "shortName": "SpeechTranslationServiceClient", - "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationServiceClient" - }, - "method": { - "shortName": "StreamingTranslateSpeech", - "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationService.StreamingTranslateSpeech", - "service": { - "shortName": "SpeechTranslationService", - "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationService" - } + "regionTag": "mediatranslation_v1beta1_generated_SpeechTranslationService_StreamingTranslateSpeech_async", + "title": "SpeechTranslationService streamingTranslateSpeech Sample", + "origin": "API_DEFINITION", + "description": " Performs bidirectional streaming speech translation: receive results while sending audio. This method is only available via the gRPC API (not REST).", + "canonical": true, + "file": "speech_translation_service.streaming_translate_speech.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamingTranslateSpeech", + "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationService.StreamingTranslateSpeech", + "async": true, + "parameters": [ + { + "name": "streaming_config", + "type": ".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig" + }, + { + "name": "audio_content", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse", + "client": { + "shortName": "SpeechTranslationServiceClient", + "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationServiceClient" + }, + "method": { + "shortName": "StreamingTranslateSpeech", + "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationService.StreamingTranslateSpeech", + "service": { + "shortName": "SpeechTranslationService", + "fullName": "google.cloud.mediatranslation.v1beta1.SpeechTranslationService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From 640992222eeb89e2326faea1c18de2aa871e1417 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 3 May 2022 02:22:26 +0200 Subject: [PATCH 124/147] chore(deps): update dependency @types/mocha to v9 (#221) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/8.2.3/9.1.1) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/compatibility-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/confidence-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 4b7a294412d..3bc314ac68d 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -30,7 +30,7 @@ "google-gax": "^2.24.1" }, "devDependencies": { - "@types/mocha": "^8.0.0", + "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", From 70fcb241198b4443a82b7af583fcf42172f759c9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:42:31 +0200 Subject: [PATCH 125/147] chore(deps): update dependency sinon to v14 (#224) 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-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 3bc314ac68d..7db6627916d 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -42,7 +42,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", + "sinon": "^14.0.0", "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From 0d13ecd39057727d211a0cc2cd89f306563d9160 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 18 May 2022 10:52:29 -0700 Subject: [PATCH 126/147] build!: update library to use Node 12 (#225) * build!: Update library to use Node 12 Co-authored-by: Owl Bot --- .../google-cloud-mediatranslation/.repo-metadata.json | 2 +- packages/google-cloud-mediatranslation/README.md | 9 +++++---- packages/google-cloud-mediatranslation/package.json | 10 +++++----- .../google-cloud-mediatranslation/samples/package.json | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-mediatranslation/.repo-metadata.json b/packages/google-cloud-mediatranslation/.repo-metadata.json index 37bc757c2a8..842eac3c808 100644 --- a/packages/google-cloud-mediatranslation/.repo-metadata.json +++ b/packages/google-cloud-mediatranslation/.repo-metadata.json @@ -2,7 +2,7 @@ "client_documentation": "https://cloud.google.com/nodejs/docs/reference/media-translation/latest", "api_id": "mediatranslation.googleapis.com", "distribution_name": "@google-cloud/media-translation", - "release_level": "preview", + "release_level": "stable", "default_version": "v1beta1", "language": "nodejs", "name_pretty": "Cloud Media Translation", diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index c46aaaaf6e0..329267dddba 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -4,7 +4,7 @@ # [Cloud Media Translation: Node.js Client](https://github.com/googleapis/nodejs-media-translation) -[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/media-translation.svg)](https://www.npmjs.org/package/@google-cloud/media-translation) @@ -175,13 +175,14 @@ This library follows [Semantic Versioning](http://semver.org/). +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 **stable** libraries +are addressed with the highest priority. -This library is considered to be in **preview**. This means it is still a -work-in-progress and under active development. Any release is subject to -backwards-incompatible changes at any time. More Information: [Google Cloud Platform Launch Stages][launch_stages] diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 7db6627916d..424e8fceab3 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -27,28 +27,28 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.24.1" + "google-gax": "^3.0.1" }, "devDependencies": { "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", - "gts": "^3.0.0", + "gts": "^3.1.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.3", - "mocha": "^8.0.0", + "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^14.0.0", "ts-loader": "^9.0.0", - "typescript": "^3.8.3", + "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=12.0.0" } } diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index ad10a4d34c2..8a0de83ba11 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" @@ -21,4 +21,4 @@ "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file From a95d8253e3b52d411449aaa761b558869e8e3590 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 31 May 2022 22:14:19 +0000 Subject: [PATCH 127/147] fix: fixes for dynamic routing and streaming descriptors (#228) - [ ] Regenerate this pull request now. Use gapic-generator-typescript v2.14.5. PiperOrigin-RevId: 450616838 Source-Link: https://github.com/googleapis/googleapis/commit/7a47b72791e0b84d78beca4c2b26bec42ce31572 Source-Link: https://github.com/googleapis/googleapis-gen/commit/42cc6331bae0b99f61b8e01ae15b05211716c4f9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDJjYzYzMzFiYWUwYjk5ZjYxYjhlMDFhZTE1YjA1MjExNzE2YzRmOSJ9 --- .../src/v1beta1/speech_translation_service_client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 9a73eb9d56c..85fa706ad32 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -162,7 +162,8 @@ export class SpeechTranslationServiceClient { // Provide descriptors for these. this.descriptors.stream = { streamingTranslateSpeech: new this._gaxModule.StreamDescriptor( - gax.StreamType.BIDI_STREAMING + gax.StreamType.BIDI_STREAMING, + opts.fallback === 'rest' ), }; From eb682f0b1ded869757198ff15f737c15a09c0bd6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 9 Jun 2022 22:14:18 +0200 Subject: [PATCH 128/147] chore(deps): update dependency jsdoc-region-tag to v2 (#231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc-region-tag](https://togithub.com/googleapis/jsdoc-region-tag) | [`^1.0.4` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-region-tag/1.3.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/compatibility-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/confidence-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-region-tag ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-region-tag/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-region-tagcomparev131v200-2022-05-20) [Compare Source](https://togithub.com/googleapis/jsdoc-region-tag/compare/v1.3.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ##### Build System - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ([5b51796](https://togithub.com/googleapis/jsdoc-region-tag/commit/5b51796771984cf8b978990025f14faa03c19923)) ##### [1.3.1](https://www.github.com/googleapis/jsdoc-region-tag/compare/v1.3.0...v1.3.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​79](https://www.togithub.com/googleapis/jsdoc-region-tag/issues/79)) ([5050615](https://www.github.com/googleapis/jsdoc-region-tag/commit/50506150b7758592df5e389c6a5c3d82b3b20881))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 424e8fceab3..a9046959c52 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -37,7 +37,7 @@ "gts": "^3.1.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", - "jsdoc-region-tag": "^1.0.4", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", From 86264f68a6a4a60b65c5a70f807b8a1a5535fbbd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 9 Jun 2022 22:34:26 +0200 Subject: [PATCH 129/147] chore(deps): update dependency jsdoc-fresh to v2 (#230) 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-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index a9046959c52..57198210d4e 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -36,7 +36,7 @@ "c8": "^7.1.0", "gts": "^3.1.0", "jsdoc": "^3.6.3", - "jsdoc-fresh": "^1.0.2", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.3", "mocha": "^9.2.2", From a2d299e1784ab1f3f1e0f2021cd556c24e20c6c2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 16:10:46 -0400 Subject: [PATCH 130/147] chore(main): release 3.0.0 (#227) See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot Co-authored-by: Benjamin E. Coe --- .../google-cloud-mediatranslation/CHANGELOG.md | 16 ++++++++++++++++ .../google-cloud-mediatranslation/package.json | 2 +- ...ta.google.cloud.mediatranslation.v1beta1.json | 2 +- .../samples/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index b6ff47539f1..b1c84e8b2e2 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [3.0.0](https://github.com/googleapis/nodejs-media-translation/compare/v2.4.0...v3.0.0) (2022-06-09) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#225) + +### Bug Fixes + +* fixes for dynamic routing and streaming descriptors ([#228](https://github.com/googleapis/nodejs-media-translation/issues/228)) ([c1bbe17](https://github.com/googleapis/nodejs-media-translation/commit/c1bbe17e481387dfeda9c842f3d30bbfee11eab6)) + + +### Build System + +* update library to use Node 12 ([#225](https://github.com/googleapis/nodejs-media-translation/issues/225)) ([25b13e3](https://github.com/googleapis/nodejs-media-translation/commit/25b13e39949ba1694254f7cb85c07f03314f1ad9)) + ## [2.4.0](https://www.github.com/googleapis/nodejs-media-translation/compare/v2.3.4...v2.4.0) (2021-09-08) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 57198210d4e..c2106546a2e 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "2.4.0", + "version": "3.0.0", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json index 2ee8660c455..b5735ee2992 100644 --- a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-mediatranslation", - "version": "2.4.0", + "version": "3.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 8a0de83ba11..40a84cddc48 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^2.4.0", + "@google-cloud/media-translation": "^3.0.0", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From fddb4c7fb62ba3a833da2e437249d1588b351daf Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:42:47 -0700 Subject: [PATCH 131/147] fix(docs): describe fallback rest option (#233) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(docs): describe fallback rest option Use gapic-generator-typescript v2.15.1. PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../src/v1beta1/speech_translation_service_client.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 85fa706ad32..679018723b0 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -67,7 +67,7 @@ export class SpeechTranslationServiceClient { * * @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] @@ -90,11 +90,10 @@ export class SpeechTranslationServiceClient { * 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 3e2d3419289d4e0b6f5bd192964bbc88c7fc868e 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:10:14 +0000 Subject: [PATCH 132/147] chore(main): release 3.0.1 (#234) :robot: I have created a release *beep* *boop* --- ## [3.0.1](https://github.com/googleapis/nodejs-media-translation/compare/v3.0.0...v3.0.1) (2022-06-30) ### Bug Fixes * **docs:** describe fallback rest option ([#233](https://github.com/googleapis/nodejs-media-translation/issues/233)) ([f83d3ed](https://github.com/googleapis/nodejs-media-translation/commit/f83d3ed1a04e4d382071df6202a1b2fb394ee2d0)) --- 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-mediatranslation/CHANGELOG.md | 7 +++++++ packages/google-cloud-mediatranslation/package.json | 2 +- ...pet_metadata.google.cloud.mediatranslation.v1beta1.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index b1c84e8b2e2..d117d4041ac 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.0.1](https://github.com/googleapis/nodejs-media-translation/compare/v3.0.0...v3.0.1) (2022-06-30) + + +### Bug Fixes + +* **docs:** describe fallback rest option ([#233](https://github.com/googleapis/nodejs-media-translation/issues/233)) ([f83d3ed](https://github.com/googleapis/nodejs-media-translation/commit/f83d3ed1a04e4d382071df6202a1b2fb394ee2d0)) + ## [3.0.0](https://github.com/googleapis/nodejs-media-translation/compare/v2.4.0...v3.0.0) (2022-06-09) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index c2106546a2e..e0d95a13a8c 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "3.0.0", + "version": "3.0.1", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json index b5735ee2992..1ba6c0153d9 100644 --- a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-mediatranslation", - "version": "3.0.0", + "version": "3.0.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 40a84cddc48..73702b8a044 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^3.0.0", + "@google-cloud/media-translation": "^3.0.1", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From c4757418ddbaf3cddaef40cbeff5b0fa695932c7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Jul 2022 22:52:11 +0200 Subject: [PATCH 133/147] chore(deps): update dependency linkinator to v4 (#238) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [linkinator](https://togithub.com/JustinBeckwith/linkinator) | [`^2.0.3` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
JustinBeckwith/linkinator ### [`v4.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.1.0...v4.0.0) ##### Features - create new release with notes ([#​508](https://togithub.com/JustinBeckwith/linkinator/issues/508)) ([2cab633](https://togithub.com/JustinBeckwith/linkinator/commit/2cab633c9659eb10794a4bac06f8b0acdc3e2c0c)) ##### BREAKING CHANGES - The commits in [#​507](https://togithub.com/JustinBeckwith/linkinator/issues/507) and [#​506](https://togithub.com/JustinBeckwith/linkinator/issues/506) both had breaking changes. They included dropping support for Node.js 12.x and updating the CSV export to be streaming, and to use a new way of writing the CSV file. This is an empty to commit using the `BREAKING CHANGE` format in the commit message to ensure a release is triggered. ### [`v3.1.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.1.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.6...v3.1.0) ##### Features - allow --skip to be defined multiple times ([#​399](https://togithub.com/JustinBeckwith/linkinator/issues/399)) ([5ca5a46](https://togithub.com/JustinBeckwith/linkinator/commit/5ca5a461508e688de12e5ae6b4cfb6565f832ebf)) ### [`v3.0.6`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.6) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.5...v3.0.6) ##### Bug Fixes - **deps:** upgrade node-glob to v8 ([#​397](https://togithub.com/JustinBeckwith/linkinator/issues/397)) ([d334dc6](https://togithub.com/JustinBeckwith/linkinator/commit/d334dc6734cd7c2b73d7ed3dea0550a6c3072ad5)) ### [`v3.0.5`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.5) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.4...v3.0.5) ##### Bug Fixes - **deps:** upgrade to htmlparser2 v8.0.1 ([#​396](https://togithub.com/JustinBeckwith/linkinator/issues/396)) ([ba3b9a8](https://togithub.com/JustinBeckwith/linkinator/commit/ba3b9a8a9b19d39af6ed91790135e833b80c1eb6)) ### [`v3.0.4`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.4) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.3...v3.0.4) ##### Bug Fixes - **deps:** update dependency gaxios to v5 ([#​391](https://togithub.com/JustinBeckwith/linkinator/issues/391)) ([48af50e](https://togithub.com/JustinBeckwith/linkinator/commit/48af50e787731204aeb7eff41325c62291311e45)) ### [`v3.0.3`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.3) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.2...v3.0.3) ##### Bug Fixes - export getConfig from index ([#​371](https://togithub.com/JustinBeckwith/linkinator/issues/371)) ([0bc0355](https://togithub.com/JustinBeckwith/linkinator/commit/0bc0355c7e2ea457f247e6b52d1577b8c4ecb3a1)) ### [`v3.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.1...v3.0.2) ##### Bug Fixes - allow server root with trailing slash ([#​370](https://togithub.com/JustinBeckwith/linkinator/issues/370)) ([8adf6b0](https://togithub.com/JustinBeckwith/linkinator/commit/8adf6b025fda250e38461f1cdad40fe08c3b3b7c)) ### [`v3.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.0...v3.0.1) ##### Bug Fixes - decode path parts in local web server ([#​369](https://togithub.com/JustinBeckwith/linkinator/issues/369)) ([4696a0c](https://togithub.com/JustinBeckwith/linkinator/commit/4696a0c38c341b178ed815f47371fca955979feb)) ### [`v3.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v2.16.2...v3.0.0) ##### Bug Fixes - **deps:** update dependency chalk to v5 ([#​362](https://togithub.com/JustinBeckwith/linkinator/issues/362)) ([4b17a8d](https://togithub.com/JustinBeckwith/linkinator/commit/4b17a8d87b649eaf813428f8ee6955e1d21dae4f)) - feat!: convert to es modules, drop node 10 ([#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359)) ([efee299](https://togithub.com/JustinBeckwith/linkinator/commit/efee299ab8a805accef751eecf8538915a4e7783)), closes [#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359) ##### BREAKING CHANGES - this module now requires node.js 12 and above, and has moved to es modules by default.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index e0d95a13a8c..3a1aa87d68d 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -38,7 +38,7 @@ "jsdoc": "^3.6.3", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.0.3", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", From 978effa2d28e837f05476dbb839d1163978794b8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 00:10:19 +0000 Subject: [PATCH 134/147] fix: better support for fallback mode (#243) - [ ] 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 --- ...google.cloud.mediatranslation.v1beta1.json | 2 +- ...tion_service.streaming_translate_speech.js | 3 + .../speech_translation_service_client.ts | 3 +- ...apic_speech_translation_service_v1beta1.ts | 212 +++++++++--------- 4 files changed, 113 insertions(+), 107 deletions(-) diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json index 1ba6c0153d9..61282734805 100644 --- a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js index feaebce89e8..beab148da7e 100644 --- a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/speech_translation_service.streaming_translate_speech.js @@ -23,6 +23,9 @@ function main() { // [START mediatranslation_v1beta1_generated_SpeechTranslationService_StreamingTranslateSpeech_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-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 679018723b0..08cec756204 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -246,7 +246,8 @@ export class SpeechTranslationServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts index a703fa613bc..4f35032bf94 100644 --- a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts +++ b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts @@ -51,124 +51,126 @@ function stubBidiStreamingCall( } describe('v1beta1.SpeechTranslationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient - .port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - fallback: true, - } - ); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.speechTranslationServiceStub, undefined); - await client.initialize(); - assert(client.speechTranslationServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.speechTranslationServiceStub, undefined); + await client.initialize(); + assert(client.speechTranslationServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - assert(client.speechTranslationServiceStub); - client.close().then(() => { - done(); + it('has close method for the initialized client', done => { + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.speechTranslationServiceStub); + client.close().then(() => { + done(); + }); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.speechTranslationServiceStub, undefined); - client.close().then(() => { - done(); + it('has close method for the non-initialized client', done => { + const client = + new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.speechTranslationServiceStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - 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 speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + 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 speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( - { - 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 speechtranslationserviceModule.v1beta1.SpeechTranslationServiceClient( + { + 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('streamingTranslateSpeech', () => { From 05735d1d67e6de99740d985359fcb8a1d78aa0d2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 07:32:17 +0000 Subject: [PATCH 135/147] fix: change import long to require (#244) 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 | 277 ++- .../protos/protos.js | 1889 ++++++++++++----- .../protos/protos.json | 24 + 3 files changed, 1632 insertions(+), 558 deletions(-) diff --git a/packages/google-cloud-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts index b4669a322ac..8a04acaf2f0 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.d.ts +++ b/packages/google-cloud-mediatranslation/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 { @@ -64,7 +64,7 @@ export namespace google { namespace SpeechTranslationService { /** - * Callback as used by {@link google.cloud.mediatranslation.v1beta1.SpeechTranslationService#streamingTranslateSpeech}. + * Callback as used by {@link google.cloud.mediatranslation.v1beta1.SpeechTranslationService|streamingTranslateSpeech}. * @param error Error, if any * @param [response] StreamingTranslateSpeechResponse */ @@ -183,6 +183,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslateSpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a StreamingTranslateSpeechConfig. */ @@ -279,6 +286,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingTranslateSpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a StreamingTranslateSpeechRequest. */ @@ -378,6 +392,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingTranslateSpeechRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a StreamingTranslateSpeechResult. */ @@ -471,6 +492,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingTranslateSpeechResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace StreamingTranslateSpeechResult { @@ -569,6 +597,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextTranslationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -672,6 +707,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingTranslateSpeechResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace StreamingTranslateSpeechResponse { @@ -793,6 +835,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. */ @@ -833,6 +882,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -880,6 +932,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 @@ -949,6 +1004,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. */ @@ -1093,6 +1155,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 { @@ -1197,6 +1266,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. */ @@ -1293,6 +1369,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; } } @@ -1384,6 +1467,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. */ @@ -1534,6 +1624,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 { @@ -1662,6 +1759,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. */ @@ -1776,6 +1880,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 { @@ -1874,6 +1985,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; } } @@ -1977,6 +2095,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. */ @@ -2079,6 +2204,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. */ @@ -2199,6 +2331,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. */ @@ -2409,6 +2548,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 { @@ -2533,6 +2679,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. */ @@ -2550,6 +2703,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -2584,6 +2740,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -2662,6 +2821,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 { @@ -2769,6 +2935,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. */ @@ -2871,6 +3044,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. */ @@ -2967,6 +3147,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. */ @@ -3069,6 +3256,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. */ @@ -3174,6 +3368,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 { @@ -3310,6 +3511,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 { @@ -3408,6 +3616,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; } } @@ -3499,6 +3714,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 { @@ -3615,6 +3837,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; } } @@ -3706,6 +3935,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 { @@ -3724,6 +3960,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. */ @@ -3747,6 +3986,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 @@ -3816,6 +4058,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 + } } } @@ -3913,6 +4172,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -4019,6 +4285,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } diff --git a/packages/google-cloud-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index 39bc8bef6c3..e9166349593 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -99,7 +99,7 @@ }; /** - * Callback as used by {@link google.cloud.mediatranslation.v1beta1.SpeechTranslationService#streamingTranslateSpeech}. + * Callback as used by {@link google.cloud.mediatranslation.v1beta1.SpeechTranslationService|streamingTranslateSpeech}. * @memberof google.cloud.mediatranslation.v1beta1.SpeechTranslationService * @typedef StreamingTranslateSpeechCallback * @type {function} @@ -270,21 +270,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.audioEncoding = reader.string(); - break; - case 2: - message.sourceLanguageCode = reader.string(); - break; - case 3: - message.targetLanguageCode = reader.string(); - break; - case 4: - message.sampleRateHertz = reader.int32(); - break; - case 5: - message.model = reader.string(); - break; + case 1: { + message.audioEncoding = reader.string(); + break; + } + case 2: { + message.sourceLanguageCode = reader.string(); + break; + } + case 3: { + message.targetLanguageCode = reader.string(); + break; + } + case 4: { + message.sampleRateHertz = reader.int32(); + break; + } + case 5: { + message.model = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -407,6 +412,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TranslateSpeechConfig + * @function getTypeUrl + * @memberof google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslateSpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig"; + }; + return TranslateSpeechConfig; })(); @@ -513,12 +533,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.audioConfig = $root.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.decode(reader, reader.uint32()); - break; - case 2: - message.singleUtterance = reader.bool(); - break; + case 1: { + message.audioConfig = $root.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.singleUtterance = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -622,6 +644,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StreamingTranslateSpeechConfig + * @function getTypeUrl + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingTranslateSpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig"; + }; + return StreamingTranslateSpeechConfig; })(); @@ -742,12 +779,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.streamingConfig = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.decode(reader, reader.uint32()); - break; - case 2: - message.audioContent = reader.bytes(); - break; + case 1: { + message.streamingConfig = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audioContent = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -822,7 +861,7 @@ if (object.audioContent != null) if (typeof object.audioContent === "string") $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0); - else if (object.audioContent.length) + else if (object.audioContent.length >= 0) message.audioContent = object.audioContent; return message; }; @@ -864,6 +903,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StreamingTranslateSpeechRequest + * @function getTypeUrl + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingTranslateSpeechRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest"; + }; + return StreamingTranslateSpeechRequest; })(); @@ -973,9 +1027,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.textTranslationResult = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.decode(reader, reader.uint32()); - break; + case 1: { + message.textTranslationResult = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1075,6 +1130,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StreamingTranslateSpeechResult + * @function getTypeUrl + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingTranslateSpeechResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult"; + }; + StreamingTranslateSpeechResult.TextTranslationResult = (function() { /** @@ -1178,12 +1248,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.translation = reader.string(); - break; - case 2: - message.isFinal = reader.bool(); - break; + case 1: { + message.translation = reader.string(); + break; + } + case 2: { + message.isFinal = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -1282,6 +1354,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TextTranslationResult + * @function getTypeUrl + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextTranslationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult"; + }; + return TextTranslationResult; })(); @@ -1402,15 +1489,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 2: - message.result = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.decode(reader, reader.uint32()); - break; - case 3: - message.speechEventType = reader.int32(); - break; + case 1: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.result = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.decode(reader, reader.uint32()); + break; + } + case 3: { + message.speechEventType = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -1540,6 +1630,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StreamingTranslateSpeechResponse + * @function getTypeUrl + * @memberof google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingTranslateSpeechResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse"; + }; + /** * SpeechEventType enum. * @name google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType @@ -1707,11 +1812,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; @@ -1818,6 +1924,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; })(); @@ -1839,6 +1960,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 */ /** @@ -1959,6 +2081,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 @@ -2014,6 +2144,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; }; @@ -2048,66 +2180,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; @@ -2219,6 +2367,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; }; @@ -2311,6 +2462,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -2342,6 +2495,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2388,6 +2542,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; }; @@ -2402,6 +2558,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; })(); @@ -2612,52 +2783,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; @@ -2958,6 +3139,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() { /** @@ -3072,15 +3268,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; @@ -3192,6 +3391,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; })(); @@ -3298,12 +3512,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; @@ -3402,6 +3618,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; })(); @@ -3502,11 +3733,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; @@ -3613,9 +3845,24 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExtensionRangeOptions; - })(); - + /** + * 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; + })(); + protobuf.FieldDescriptorProto = (function() { /** @@ -3818,39 +4065,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; @@ -4137,6 +4395,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 @@ -4305,12 +4578,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; @@ -4414,6 +4689,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; })(); @@ -4559,27 +4849,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; @@ -4755,6 +5050,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() { /** @@ -4858,12 +5168,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; @@ -4962,6 +5274,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; })(); @@ -5082,15 +5409,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; @@ -5202,6 +5532,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; })(); @@ -5321,17 +5666,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; @@ -5461,6 +5809,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; })(); @@ -5611,24 +5974,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; @@ -5764,6 +6133,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; })(); @@ -6081,71 +6465,92 @@ 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 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -6432,6 +6837,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 @@ -6589,23 +7009,28 @@ 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 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; + } default: reader.skipType(tag & 7); break; @@ -6746,6 +7171,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; })(); @@ -6759,6 +7199,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 @@ -6814,6 +7255,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -6882,6 +7331,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(); @@ -6925,39 +7376,51 @@ 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; + break; + } default: reader.skipType(tag & 7); break; @@ -7017,6 +7480,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"; @@ -7097,6 +7563,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) @@ -7179,6 +7647,7 @@ object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = false; + object.unverifiedLazy = false; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; @@ -7192,6 +7661,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) @@ -7216,6 +7687,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 @@ -7345,11 +7831,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; @@ -7456,6 +7943,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; })(); @@ -7575,17 +8077,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; @@ -7710,6 +8215,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; })(); @@ -7818,14 +8338,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; @@ -7941,6 +8463,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; })(); @@ -8071,20 +8608,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; @@ -8217,6 +8758,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; })(); @@ -8349,22 +8905,26 @@ 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 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 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; @@ -8528,6 +9088,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 @@ -8707,29 +9282,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; @@ -8842,7 +9424,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); @@ -8923,6 +9505,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() { /** @@ -9024,12 +9621,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; @@ -9130,6 +9729,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; })(); @@ -9230,11 +9844,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; @@ -9341,6 +9956,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() { /** @@ -9489,37 +10119,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; @@ -9680,6 +10315,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; })(); @@ -9780,11 +10430,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; @@ -9891,6 +10542,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() { /** @@ -9901,6 +10567,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 */ /** @@ -9951,6 +10618,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 @@ -9987,6 +10662,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; }; @@ -10021,25 +10698,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; @@ -10091,6 +10776,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; }; @@ -10119,6 +10813,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; }; @@ -10141,6 +10849,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -10153,6 +10862,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; }; @@ -10167,6 +10878,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; })(); @@ -10276,12 +11018,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -10343,7 +11087,7 @@ if (object.value != null) if (typeof object.value === "string") $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) + else if (object.value.length >= 0) message.value = object.value; return message; }; @@ -10389,6 +11133,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + return Any; })(); @@ -10520,17 +11279,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.code = reader.int32(); - break; - case 2: - message.message = reader.string(); - break; - case 3: - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -10655,6 +11417,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + return Status; })(); diff --git a/packages/google-cloud-mediatranslation/protos/protos.json b/packages/google-cloud-mediatranslation/protos/protos.json index 367a5a13107..84f96f9c18b 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.json +++ b/packages/google-cloud-mediatranslation/protos/protos.json @@ -310,6 +310,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -838,6 +842,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -1130,6 +1141,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From 748ad24df37c8191773b9de36d82a4bb77789d62 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 26 Aug 2022 12:31:25 -0700 Subject: [PATCH 136/147] chore(main): release 3.0.2 (#245) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.2 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-mediatranslation/CHANGELOG.md | 9 +++++++++ packages/google-cloud-mediatranslation/package.json | 2 +- ...t_metadata.google.cloud.mediatranslation.v1beta1.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index d117d4041ac..681f2d19465 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [3.0.2](https://github.com/googleapis/nodejs-media-translation/compare/v3.0.1...v3.0.2) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#243](https://github.com/googleapis/nodejs-media-translation/issues/243)) ([a0dc4be](https://github.com/googleapis/nodejs-media-translation/commit/a0dc4be632b474ef5fe3a3df3719743fc31b911b)) +* change import long to require ([#244](https://github.com/googleapis/nodejs-media-translation/issues/244)) ([31a670e](https://github.com/googleapis/nodejs-media-translation/commit/31a670ed83c2de493a15504422b3c2a09612ef05)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-media-translation/issues/1546)) ([#247](https://github.com/googleapis/nodejs-media-translation/issues/247)) ([8a11196](https://github.com/googleapis/nodejs-media-translation/commit/8a11196b52832ff61ad709f9f12683185bc6e96a)) + ## [3.0.1](https://github.com/googleapis/nodejs-media-translation/compare/v3.0.0...v3.0.1) (2022-06-30) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 3a1aa87d68d..b1672adf94f 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "3.0.1", + "version": "3.0.2", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json index 61282734805..e5f171725d8 100644 --- a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-mediatranslation", - "version": "3.0.1", + "version": "3.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 73702b8a044..a044e1252d3 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^3.0.1", + "@google-cloud/media-translation": "^3.0.2", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From dcb7f5fa5030a7981cd0d1c5955ba194b081a72d 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:02:24 +0000 Subject: [PATCH 137/147] fix: do not import the whole google-gax from proto JS (#1553) (#248) 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-mediatranslation/package.json | 2 +- packages/google-cloud-mediatranslation/protos/protos.d.ts | 2 +- packages/google-cloud-mediatranslation/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index b1672adf94f..87f15fbe7ac 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts index 8a04acaf2f0..1efe5016b30 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.d.ts +++ b/packages/google-cloud-mediatranslation/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-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index e9166349593..d8762fff6d5 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/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 35d6beead1039e4549dbdae45fdcd7f7f348a24d 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:40:16 +0000 Subject: [PATCH 138/147] fix: allow passing gax instance to client constructor (#249) - [ ] 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 --- .../speech_translation_service_client.ts | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts index 08cec756204..7e8904f3cbf 100644 --- a/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts +++ b/packages/google-cloud-mediatranslation/src/v1beta1/speech_translation_service_client.ts @@ -17,15 +17,13 @@ // ** 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, ClientOptions, - GoogleError, } from 'google-gax'; - import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -35,7 +33,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './speech_translation_service_client_config.json'; - const version = require('../../../package.json').version; /** @@ -94,8 +91,18 @@ export class SpeechTranslationServiceClient { * 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 SpeechTranslationServiceClient({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 SpeechTranslationServiceClient; @@ -116,8 +123,13 @@ export class SpeechTranslationServiceClient { 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); @@ -161,7 +173,7 @@ export class SpeechTranslationServiceClient { // Provide descriptors for these. this.descriptors.stream = { streamingTranslateSpeech: new this._gaxModule.StreamDescriptor( - gax.StreamType.BIDI_STREAMING, + this._gaxModule.StreamType.BIDI_STREAMING, opts.fallback === 'rest' ), }; @@ -180,7 +192,7 @@ export class SpeechTranslationServiceClient { 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; } /** @@ -227,7 +239,9 @@ export class SpeechTranslationServiceClient { setImmediate(() => { stream.emit( 'error', - new GoogleError('The client has already been closed.') + new this._gaxModule.GoogleError( + 'The client has already been closed.' + ) ); }); return stream; From 478dc8ac22122eab0ea5391fa9e7002fad54d9fd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:50:11 -0400 Subject: [PATCH 139/147] chore(main): release 3.0.3 (#250) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.3 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-mediatranslation/CHANGELOG.md | 8 ++++++++ packages/google-cloud-mediatranslation/package.json | 2 +- ...et_metadata.google.cloud.mediatranslation.v1beta1.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index 681f2d19465..daa3e817ffd 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [3.0.3](https://github.com/googleapis/nodejs-media-translation/compare/v3.0.2...v3.0.3) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#249](https://github.com/googleapis/nodejs-media-translation/issues/249)) ([ff9aebb](https://github.com/googleapis/nodejs-media-translation/commit/ff9aebb808d91ce68f967afd73e933bfab1a6f31)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-media-translation/issues/1553)) ([#248](https://github.com/googleapis/nodejs-media-translation/issues/248)) ([719d39f](https://github.com/googleapis/nodejs-media-translation/commit/719d39f3a38b60ee708af7d620c37982bf9bf834)) + ## [3.0.2](https://github.com/googleapis/nodejs-media-translation/compare/v3.0.1...v3.0.2) (2022-08-23) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 87f15fbe7ac..2b86004a3f6 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "3.0.2", + "version": "3.0.3", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json index e5f171725d8..27e593db574 100644 --- a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-mediatranslation", - "version": "3.0.2", + "version": "3.0.3", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index a044e1252d3..42153d5fe5d 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^3.0.2", + "@google-cloud/media-translation": "^3.0.3", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From 79e6c4f2802002f22c3b798959d88494bd09e6e9 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:34:34 +0000 Subject: [PATCH 140/147] fix: preserve default values in x-goog-request-params header (#251) - [ ] 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 --- .../gapic_speech_translation_service_v1beta1.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts index 4f35032bf94..04141262a4e 100644 --- a/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.ts +++ b/packages/google-cloud-mediatranslation/test/gapic_speech_translation_service_v1beta1.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 @@ -186,6 +201,7 @@ describe('v1beta1.SpeechTranslationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechRequest() ); + const expectedResponse = generateSampleMessage( new protos.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse() ); From 7dd4f80fd144b14df1d3841457d5c295421b231f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 14:48:56 -0700 Subject: [PATCH 141/147] chore(main): release 3.0.4 (#252) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.4 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-mediatranslation/CHANGELOG.md | 7 +++++++ packages/google-cloud-mediatranslation/package.json | 2 +- ...pet_metadata.google.cloud.mediatranslation.v1beta1.json | 2 +- .../google-cloud-mediatranslation/samples/package.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index daa3e817ffd..2a51600e204 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.0.4](https://github.com/googleapis/nodejs-media-translation/compare/v3.0.3...v3.0.4) (2022-09-14) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#251](https://github.com/googleapis/nodejs-media-translation/issues/251)) ([8257ade](https://github.com/googleapis/nodejs-media-translation/commit/8257ade7fd05bd65161d7a8c156e6c04fc09bfbe)) + ## [3.0.3](https://github.com/googleapis/nodejs-media-translation/compare/v3.0.2...v3.0.3) (2022-09-01) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 2b86004a3f6..65e298a4cd8 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "3.0.3", + "version": "3.0.4", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json index 27e593db574..89379b81166 100644 --- a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-mediatranslation", - "version": "3.0.3", + "version": "3.0.4", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json index 42153d5fe5d..9759a14c1a7 100644 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ b/packages/google-cloud-mediatranslation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/media-translation": "^3.0.3", + "@google-cloud/media-translation": "^3.0.4", "node-record-lpcm16": "1.0.1" }, "devDependencies": { From 402f06c45595b7fb3d0b22c5f087e335da79889a Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 Nov 2022 23:46:37 -0700 Subject: [PATCH 142/147] fix(deps): use google-gax v3.5.2 (#258) --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 65e298a4cd8..3a3131650fd 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^3.3.0" + "google-gax": "^3.5.2" }, "devDependencies": { "@types/mocha": "^9.0.0", From 63f81a5783da628ec68607febf2d9d7fd5a66988 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 10:32:18 +0100 Subject: [PATCH 143/147] chore(deps): update dependency @types/node to v18 (#256) 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-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 3a3131650fd..dbe569da31c 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^3.1.0", From e78b63913b412fd131d83c26a6067e782e1bd1ce Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 11:10:29 +0100 Subject: [PATCH 144/147] chore(deps): update dependency jsdoc to v4 (#261) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc](https://togithub.com/jsdoc/jsdoc) | [`^3.6.3` -> `^4.0.0`](https://renovatebot.com/diffs/npm/jsdoc/3.6.11/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/compatibility-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/confidence-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
jsdoc/jsdoc ### [`v4.0.0`](https://togithub.com/jsdoc/jsdoc/blob/HEAD/CHANGES.md#​400-November-2022) [Compare Source](https://togithub.com/jsdoc/jsdoc/compare/3.6.11...084218523a7d69fec14a852ce680f374f526af28) - JSDoc releases now use [semantic versioning](https://semver.org/). If JSDoc makes backwards-incompatible changes in the future, the major version will be incremented. - JSDoc no longer uses the [`taffydb`](https://taffydb.com/) package. If your JSDoc template or plugin uses the `taffydb` package, see the [instructions for replacing `taffydb` with `@jsdoc/salty`](https://togithub.com/jsdoc/jsdoc/tree/main/packages/jsdoc-salty#use-salty-in-a-jsdoc-template). - JSDoc now supports Node.js 12.0.0 and later.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-media-translation). --- packages/google-cloud-mediatranslation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index dbe569da31c..a36aabdc332 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -35,7 +35,7 @@ "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^3.1.0", - "jsdoc": "^3.6.3", + "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^4.0.0", From dc4f303aecc42da74718dbefe3d8eb3617402ea9 Mon Sep 17 00:00:00 2001 From: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com> Date: Thu, 10 Nov 2022 18:04:13 -0600 Subject: [PATCH 145/147] chore: delete transferred samples (#263) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: delete transferred samples * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * build: update package.json to ignore samples folder Co-authored-by: Owl Bot Co-authored-by: Sofia Leon --- .../google-cloud-mediatranslation/README.md | 92 +--------------- .../package.json | 2 - .../samples/README.md | 86 --------------- .../samples/package.json | 24 ----- .../samples/quickstart.js | 101 ------------------ .../samples/test/quickstart.test.js | 31 ------ 6 files changed, 2 insertions(+), 334 deletions(-) delete mode 100644 packages/google-cloud-mediatranslation/samples/README.md delete mode 100644 packages/google-cloud-mediatranslation/samples/package.json delete mode 100644 packages/google-cloud-mediatranslation/samples/quickstart.js delete mode 100644 packages/google-cloud-mediatranslation/samples/test/quickstart.test.js diff --git a/packages/google-cloud-mediatranslation/README.md b/packages/google-cloud-mediatranslation/README.md index 329267dddba..697dbd9f5f9 100644 --- a/packages/google-cloud-mediatranslation/README.md +++ b/packages/google-cloud-mediatranslation/README.md @@ -31,8 +31,8 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. * [Quickstart](#quickstart) * [Before you begin](#before-you-begin) * [Installing the client library](#installing-the-client-library) - * [Using the client library](#using-the-client-library) -* [Samples](#samples) + + * [Versioning](#versioning) * [Contributing](#contributing) * [License](#license) @@ -54,94 +54,6 @@ npm install @google-cloud/media-translation ``` -### Using the client library - -```javascript -const fs = require('fs'); - -// Imports the CLoud Media Translation client library -const { - SpeechTranslationServiceClient, -} = require('@google-cloud/media-translation'); - -// Creates a client -const client = new SpeechTranslationServiceClient(); - -async function quickstart() { - /** - * TODO(developer): Uncomment the following lines before running the sample. - */ - // const filename = 'Local path to audio file, e.g. /path/to/audio.raw'; - // const encoding = 'Encoding of the audio file, e.g. LINEAR16'; - // const sourceLanguage = 'BCP-47 source language code, e.g. en-US'; - // const targetLanguage = 'BCP-47 target language code, e.g. es-ES'; - - const config = { - audioConfig: { - audioEncoding: encoding, - sourceLanguageCode: sourceLanguage, - targetLanguageCode: targetLanguage, - }, - }; - - // First request needs to have only a streaming config, no data. - const initialRequest = { - streamingConfig: config, - audioContent: null, - }; - - const readStream = fs.createReadStream(filename, { - highWaterMark: 4096, - encoding: 'base64', - }); - - const chunks = []; - readStream - .on('data', chunk => { - const request = { - streamingConfig: config, - audioContent: chunk.toString(), - }; - chunks.push(request); - }) - .on('close', () => { - // Config-only request should be first in stream of requests - stream.write(initialRequest); - for (let i = 0; i < chunks.length; i++) { - stream.write(chunks[i]); - } - stream.end(); - }); - - const stream = client.streamingTranslateSpeech().on('data', response => { - const {result} = response; - if (result.textTranslationResult.isFinal) { - console.log( - `\nFinal translation: ${result.textTranslationResult.translation}` - ); - console.log(`Final recognition result: ${result.recognitionResult}`); - } else { - console.log( - `\nPartial translation: ${result.textTranslationResult.translation}` - ); - console.log(`Partial recognition result: ${result.recognitionResult}`); - } - }); - - -``` - - - -## Samples - -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-media-translation/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-media-translation/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-media-translation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Translate_from_file | [source code](https://github.com/googleapis/nodejs-media-translation/blob/main/samples/translate_from_file.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_file.js,samples/README.md) | -| Translate_from_mic | [source code](https://github.com/googleapis/nodejs-media-translation/blob/main/samples/translate_from_mic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_mic.js,samples/README.md) | diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index a36aabdc332..71f6d523351 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -22,8 +22,6 @@ "test": "c8 mocha build/test", "fix": "gts fix", "lint": "gts check", - "prelint": "cd samples; npm link ../; npm install", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "precompile": "gts clean" }, "dependencies": { diff --git a/packages/google-cloud-mediatranslation/samples/README.md b/packages/google-cloud-mediatranslation/samples/README.md deleted file mode 100644 index f27abf4ec83..00000000000 --- a/packages/google-cloud-mediatranslation/samples/README.md +++ /dev/null @@ -1,86 +0,0 @@ -[//]: # "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 - -# [Cloud Media Translation: Node.js Samples](https://github.com/googleapis/nodejs-media-translation) - -[![Open in Cloud Shell][shell_img]][shell_link] - - - -## Table of Contents - -* [Before you begin](#before-you-begin) -* [Samples](#samples) - * [Quickstart](#quickstart) - * [Translate_from_file](#translate_from_file) - * [Translate_from_mic](#translate_from_mic) - -## 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-media-translation#using-the-client-library). - -`cd samples` - -`npm install` - -`cd ..` - -## Samples - - - -### Quickstart - -View the [source code](https://github.com/googleapis/nodejs-media-translation/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-media-translation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) - -__Usage:__ - - -`node samples/quickstart.js` - - ------ - - - - -### Translate_from_file - -View the [source code](https://github.com/googleapis/nodejs-media-translation/blob/main/samples/translate_from_file.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_file.js,samples/README.md) - -__Usage:__ - - -`node samples/translate_from_file.js` - - ------ - - - - -### Translate_from_mic - -View the [source code](https://github.com/googleapis/nodejs-media-translation/blob/main/samples/translate_from_mic.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-media-translation&page=editor&open_in_editor=samples/translate_from_mic.js,samples/README.md) - -__Usage:__ - - -`node samples/translate_from_mic.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-media-translation&page=editor&open_in_editor=samples/README.md -[product-docs]: https://cloud.google.com/translate/media/docs/ diff --git a/packages/google-cloud-mediatranslation/samples/package.json b/packages/google-cloud-mediatranslation/samples/package.json deleted file mode 100644 index 9759a14c1a7..00000000000 --- a/packages/google-cloud-mediatranslation/samples/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "media-translation-samples", - "private": true, - "license": "Apache-2.0", - "author": "Google LLC", - "engines": { - "node": ">=12.0.0" - }, - "files": [ - "*.js" - ], - "scripts": { - "test": "c8 mocha --timeout 600000 test/*.js" - }, - "dependencies": { - "@google-cloud/media-translation": "^3.0.4", - "node-record-lpcm16": "1.0.1" - }, - "devDependencies": { - "c8": "^7.0.0", - "chai": "^4.2.0", - "mocha": "^8.0.0" - } -} \ No newline at end of file diff --git a/packages/google-cloud-mediatranslation/samples/quickstart.js b/packages/google-cloud-mediatranslation/samples/quickstart.js deleted file mode 100644 index 1232e4fdaa9..00000000000 --- a/packages/google-cloud-mediatranslation/samples/quickstart.js +++ /dev/null @@ -1,101 +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. - -'use strict'; - -/** - * Translate text from an audio file. - * @param {string} filename local path to - * @param {string} encoding the encoding of the audio rate, e.g. Linear16 - * @param {string} sourceLanguage language translating from, as BCP-47 code - * @param {string} targetLanguage languate translating to, as BCP-47 code - */ -function main(filename, encoding, sourceLanguage, targetLanguage) { - // [START media_translation_quickstart] - const fs = require('fs'); - - // Imports the CLoud Media Translation client library - const { - SpeechTranslationServiceClient, - } = require('@google-cloud/media-translation'); - - // Creates a client - const client = new SpeechTranslationServiceClient(); - - async function quickstart() { - /** - * TODO(developer): Uncomment the following lines before running the sample. - */ - // const filename = 'Local path to audio file, e.g. /path/to/audio.raw'; - // const encoding = 'Encoding of the audio file, e.g. LINEAR16'; - // const sourceLanguage = 'BCP-47 source language code, e.g. en-US'; - // const targetLanguage = 'BCP-47 target language code, e.g. es-ES'; - - const config = { - audioConfig: { - audioEncoding: encoding, - sourceLanguageCode: sourceLanguage, - targetLanguageCode: targetLanguage, - }, - }; - - // First request needs to have only a streaming config, no data. - const initialRequest = { - streamingConfig: config, - audioContent: null, - }; - - const readStream = fs.createReadStream(filename, { - highWaterMark: 4096, - encoding: 'base64', - }); - - const chunks = []; - readStream - .on('data', chunk => { - const request = { - streamingConfig: config, - audioContent: chunk.toString(), - }; - chunks.push(request); - }) - .on('close', () => { - // Config-only request should be first in stream of requests - stream.write(initialRequest); - for (let i = 0; i < chunks.length; i++) { - stream.write(chunks[i]); - } - stream.end(); - }); - - const stream = client.streamingTranslateSpeech().on('data', response => { - const {result} = response; - if (result.textTranslationResult.isFinal) { - console.log( - `\nFinal translation: ${result.textTranslationResult.translation}` - ); - console.log(`Final recognition result: ${result.recognitionResult}`); - } else { - console.log( - `\nPartial translation: ${result.textTranslationResult.translation}` - ); - console.log(`Partial recognition result: ${result.recognitionResult}`); - } - }); - - // [END media_translation_quickstart] - } - quickstart(); -} - -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-mediatranslation/samples/test/quickstart.test.js b/packages/google-cloud-mediatranslation/samples/test/quickstart.test.js deleted file mode 100644 index c031c441297..00000000000 --- a/packages/google-cloud-mediatranslation/samples/test/quickstart.test.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const path = require('path'); -const {assert} = require('chai'); -const {describe, it} = require('mocha'); -const execSync = require('child_process').execSync; -const cmd = 'node quickstart.js'; - -const filePath = path.join(__dirname, '..', 'resources/audio.raw'); -const exec = cmd => execSync(cmd, {encoding: 'utf-8'}); - -describe('Quickstart', () => { - it('should translate from a streamed file', async () => { - const stdout = exec(`${cmd} ${filePath} linear16 en-US es-ES`); - assert.include(stdout, 'Partial translation'); - }); -}); From 76f1c941a7eef534773157509e1bdd423d5d4bab Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 01:42:18 +0000 Subject: [PATCH 146/147] fix: regenerated protos JS and TS definitions (#262) 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 | 70 ++++++++++++++++--- 2 files changed, 62 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-mediatranslation/protos/protos.d.ts b/packages/google-cloud-mediatranslation/protos/protos.d.ts index 1efe5016b30..dc60e7e74cb 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.d.ts +++ b/packages/google-cloud-mediatranslation/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-mediatranslation/protos/protos.js b/packages/google-cloud-mediatranslation/protos/protos.js index d8762fff6d5..94e73040ce8 100644 --- a/packages/google-cloud-mediatranslation/protos/protos.js +++ b/packages/google-cloud-mediatranslation/protos/protos.js @@ -1580,6 +1580,12 @@ message.result = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.fromObject(object.result); } switch (object.speechEventType) { + default: + if (typeof object.speechEventType === "number") { + message.speechEventType = object.speechEventType; + break; + } + break; case "SPEECH_EVENT_TYPE_UNSPECIFIED": case 0: message.speechEventType = 0; @@ -1615,7 +1621,7 @@ if (message.result != null && message.hasOwnProperty("result")) object.result = $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.toObject(message.result, options); if (message.speechEventType != null && message.hasOwnProperty("speechEventType")) - object.speechEventType = options.enums === String ? $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType[message.speechEventType] : message.speechEventType; + object.speechEventType = options.enums === String ? $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType[message.speechEventType] === undefined ? message.speechEventType : $root.google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResponse.SpeechEventType[message.speechEventType] : message.speechEventType; return object; }; @@ -4226,6 +4232,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; @@ -4240,6 +4252,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; @@ -4366,9 +4384,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")) @@ -6687,6 +6705,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; @@ -6783,7 +6807,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")) @@ -7532,6 +7556,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; @@ -7548,6 +7578,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; @@ -7586,6 +7622,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; @@ -7650,7 +7690,7 @@ object.unverifiedLazy = false; } 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")) @@ -7658,7 +7698,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")) @@ -7671,7 +7711,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]; } return object; }; @@ -9006,6 +9046,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; @@ -9063,7 +9109,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) @@ -10814,6 +10860,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; @@ -10863,7 +10915,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 60ace4ea1f7be0856c68b8abe45b38379806a0ac Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 01:29:26 -0800 Subject: [PATCH 147/147] chore(main): release 3.0.5 (#260) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.5 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-mediatranslation/CHANGELOG.md | 8 ++++++++ packages/google-cloud-mediatranslation/package.json | 2 +- ...et_metadata.google.cloud.mediatranslation.v1beta1.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-mediatranslation/CHANGELOG.md b/packages/google-cloud-mediatranslation/CHANGELOG.md index 2a51600e204..4b9b36c6491 100644 --- a/packages/google-cloud-mediatranslation/CHANGELOG.md +++ b/packages/google-cloud-mediatranslation/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [3.0.5](https://github.com/googleapis/nodejs-media-translation/compare/v3.0.4...v3.0.5) (2022-11-11) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#258](https://github.com/googleapis/nodejs-media-translation/issues/258)) ([1e26910](https://github.com/googleapis/nodejs-media-translation/commit/1e2691026bf580a0330d70f0f854987b7f96c865)) +* Regenerated protos JS and TS definitions ([#262](https://github.com/googleapis/nodejs-media-translation/issues/262)) ([18948d2](https://github.com/googleapis/nodejs-media-translation/commit/18948d24a7b262db7211e47366cb1fd9f5499df6)) + ## [3.0.4](https://github.com/googleapis/nodejs-media-translation/compare/v3.0.3...v3.0.4) (2022-09-14) diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 71f6d523351..c5e16dd1353 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/media-translation", - "version": "3.0.4", + "version": "3.0.5", "description": "Mediatranslation client for Node.js", "repository": "googleapis/nodejs-media-translation", "license": "Apache-2.0", diff --git a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json index 89379b81166..e24ce10ed28 100644 --- a/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json +++ b/packages/google-cloud-mediatranslation/samples/generated/v1beta1/snippet_metadata.google.cloud.mediatranslation.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-mediatranslation", - "version": "3.0.4", + "version": "3.0.5", "language": "TYPESCRIPT", "apis": [ {