diff --git a/packages/google-cloud-connectors/.OwlBot.yaml b/packages/google-cloud-connectors/.OwlBot.yaml new file mode 100644 index 00000000000..2f09abb76d0 --- /dev/null +++ b/packages/google-cloud-connectors/.OwlBot.yaml @@ -0,0 +1,19 @@ +# 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 +# +# 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. + +deep-copy-regex: + - source: /google/cloud/connectors/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-connectors/$1 + +api-name: connectors \ No newline at end of file diff --git a/packages/google-cloud-connectors/.eslintignore b/packages/google-cloud-connectors/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-connectors/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-connectors/.eslintrc.json b/packages/google-cloud-connectors/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-connectors/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-connectors/.gitattributes b/packages/google-cloud-connectors/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-connectors/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-connectors/.gitignore b/packages/google-cloud-connectors/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/google-cloud-connectors/.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-connectors/.jsdoc.js b/packages/google-cloud-connectors/.jsdoc.js new file mode 100644 index 00000000000..b9105690d39 --- /dev/null +++ b/packages/google-cloud-connectors/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/connectors', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-connectors/.mocharc.js b/packages/google-cloud-connectors/.mocharc.js new file mode 100644 index 00000000000..49e7e228701 --- /dev/null +++ b/packages/google-cloud-connectors/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-connectors/.nycrc b/packages/google-cloud-connectors/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-connectors/.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-connectors/.prettierignore b/packages/google-cloud-connectors/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-connectors/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-connectors/.prettierrc.js b/packages/google-cloud-connectors/.prettierrc.js new file mode 100644 index 00000000000..1e6cec783e4 --- /dev/null +++ b/packages/google-cloud-connectors/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-connectors/.repo-metadata.json b/packages/google-cloud-connectors/.repo-metadata.json new file mode 100644 index 00000000000..3436f6bbe66 --- /dev/null +++ b/packages/google-cloud-connectors/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "connectors", + "name_pretty": "Connectors API", + "product_documentation": "", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/connectors/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/connectors", + "api_id": "connectors.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "connectors" +} + diff --git a/packages/google-cloud-connectors/CODE_OF_CONDUCT.md b/packages/google-cloud-connectors/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-connectors/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-connectors/CONTRIBUTING.md b/packages/google-cloud-connectors/CONTRIBUTING.md new file mode 100644 index 00000000000..c9b184fabcc --- /dev/null +++ b/packages/google-cloud-connectors/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Connectors API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=connectors.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-connectors/LICENSE b/packages/google-cloud-connectors/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-connectors/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-connectors/README.md b/packages/google-cloud-connectors/README.md new file mode 100644 index 00000000000..8a67d32d1e8 --- /dev/null +++ b/packages/google-cloud-connectors/README.md @@ -0,0 +1,210 @@ +[//]: # "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 + +# [Connectors API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors) + +[![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/connectors.svg)](https://www.npmjs.org/package/@google-cloud/connectors) + + + + +Connectors API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors/CHANGELOG.md). + +* [Connectors API Node.js Client API Reference][client-docs] + +* [github.com/googleapis/google-cloud-node/packages/google-cloud-connectors](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors) + +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) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [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 Connectors API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/connectors +``` + + +### Using the client library + +```javascript +/** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + */ +// const parent = 'abc123' +/** + * Page size. + */ +// const pageSize = 1234 +/** + * Page token. + */ +// const pageToken = 'abc123' +/** + * Filter. + */ +// const filter = 'abc123' +/** + * Order by parameters. + */ +// const orderBy = 'abc123' +/** + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + */ +// const view = {} + +// Imports the Connectors library +const {ConnectorsClient} = require('@google-cloud/connectors').v1; + +// Instantiates a client +const connectorsClient = new ConnectorsClient(); + +async function callListConnections() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listConnectionsAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +callListConnections(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Connectors.create_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.delete_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_connection_schema_metadata | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_connector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_connector_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_global_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_provider | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_runtime_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_connections | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_connector_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_connectors | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_providers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_runtime_action_schemas | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_runtime_entity_schemas | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.refresh_connection_schema_metadata | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.update_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js,packages/google-cloud-connectors/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/quickstart.js,packages/google-cloud-connectors/samples/README.md) | + + + +The [Connectors API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +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. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +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/connectors@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +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] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/connectors/latest + +[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=connectors.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-connectors/package.json b/packages/google-cloud-connectors/package.json new file mode 100644 index 00000000000..54cb642a299 --- /dev/null +++ b/packages/google-cloud-connectors/package.json @@ -0,0 +1,70 @@ +{ + "name": "@google-cloud/connectors", + "version": "0.0.0", + "description": "Connectors API client for Node.js", + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/google-cloud-connectors" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google connectors", + "connectors", + "Connectors API" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "postpack": "minifyProtoJson", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^4.0.3" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^20.4.5", + "@types/sinon": "^10.0.0", + "c8": "^8.0.1", + "gapic-tools": "^0.1.8", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "4.1.2", + "long": "^5.2.3", + "mocha": "^9.2.2", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "typescript": "^5.1.6" + }, + "engines": { + "node": ">=14.0.0" + } +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/authconfig.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/authconfig.proto new file mode 100644 index 00000000000..d7ef19b4e7d --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/authconfig.proto @@ -0,0 +1,145 @@ +// Copyright 2023 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.connectors.v1; + +import "google/cloud/connectors/v1/common.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "AuthConfigProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// AuthConfig defines details of a authentication type. +message AuthConfig { + // Parameters to support Username and Password Authentication. + message UserPassword { + // Username. + string username = 1; + + // Secret version reference containing the password. + Secret password = 2; + } + + // Parameters to support JSON Web Token (JWT) Profile for Oauth 2.0 + // Authorization Grant based authentication. + // See https://tools.ietf.org/html/rfc7523 for more details. + message Oauth2JwtBearer { + // JWT claims used for the jwt-bearer authorization grant. + message JwtClaims { + // Value for the "iss" claim. + string issuer = 1; + + // Value for the "sub" claim. + string subject = 2; + + // Value for the "aud" claim. + string audience = 3; + } + + // Secret version reference containing a PKCS#8 PEM-encoded private + // key associated with the Client Certificate. This private key will be + // used to sign JWTs used for the jwt-bearer authorization grant. + // Specified in the form as: `projects/*/secrets/*/versions/*`. + Secret client_key = 1; + + // JwtClaims providers fields to generate the token. + JwtClaims jwt_claims = 2; + } + + // Parameters to support Oauth 2.0 Client Credentials Grant Authentication. + // See https://tools.ietf.org/html/rfc6749#section-1.3.4 for more details. + message Oauth2ClientCredentials { + // The client identifier. + string client_id = 1; + + // Secret version reference containing the client secret. + Secret client_secret = 2; + } + + // Parameters to support Ssh public key Authentication. + message SshPublicKey { + // The user account used to authenticate. + string username = 1; + + // SSH Client Cert. It should contain both public and private key. + Secret ssh_client_cert = 3; + + // Format of SSH Client cert. + string cert_type = 4; + + // Password (passphrase) for ssh client certificate if it has one. + Secret ssh_client_cert_pass = 5; + } + + // The type of authentication configured. + AuthType auth_type = 1; + + // Supported auth types. + oneof type { + // UserPassword. + UserPassword user_password = 2; + + // Oauth2JwtBearer. + Oauth2JwtBearer oauth2_jwt_bearer = 3; + + // Oauth2ClientCredentials. + Oauth2ClientCredentials oauth2_client_credentials = 4; + + // SSH Public Key. + SshPublicKey ssh_public_key = 6; + } + + // List containing additional auth configs. + repeated ConfigVariable additional_variables = 5; +} + +// AuthConfigTemplate defines required field over an authentication type. +message AuthConfigTemplate { + // The type of authentication configured. + AuthType auth_type = 1; + + // Config variables to describe an `AuthConfig` for a `Connection`. + repeated ConfigVariableTemplate config_variable_templates = 2; + + // Display name for authentication template. + string display_name = 3; + + // Connector specific description for an authentication template. + string description = 4; +} + +// AuthType defines different authentication types. +enum AuthType { + // Authentication type not specified. + AUTH_TYPE_UNSPECIFIED = 0; + + // Username and Password Authentication. + USER_PASSWORD = 1; + + // JSON Web Token (JWT) Profile for Oauth 2.0 + // Authorization Grant based authentication + OAUTH2_JWT_BEARER = 2; + + // Oauth 2.0 Client Credentials Grant Authentication + OAUTH2_CLIENT_CREDENTIALS = 3; + + // SSH Public Key Authentication + SSH_PUBLIC_KEY = 4; + + // Oauth 2.0 Authorization Code Flow + OAUTH2_AUTH_CODE_FLOW = 5; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/common.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/common.proto new file mode 100644 index 00000000000..64efe869311 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/common.proto @@ -0,0 +1,267 @@ +// Copyright 2023 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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ConfigVariableTemplate provides metadata about a `ConfigVariable` that is +// used in a Connection. +message ConfigVariableTemplate { + // ValueType indicates the data type of the value. + enum ValueType { + // Value type is not specified. + VALUE_TYPE_UNSPECIFIED = 0; + + // Value type is string. + STRING = 1; + + // Value type is integer. + INT = 2; + + // Value type is boolean. + BOOL = 3; + + // Value type is secret. + SECRET = 4; + + // Value type is enum. + ENUM = 5; + + // Value type is authorization code. + AUTHORIZATION_CODE = 6; + } + + // Indicates the state of the config variable. + enum State { + // Status is unspecified. + STATE_UNSPECIFIED = 0; + + // Config variable is active + ACTIVE = 1; + + // Config variable is deprecated. + DEPRECATED = 2; + } + + // Key of the config variable. + string key = 1; + + // Type of the parameter: string, int, bool etc. + // consider custom type for the benefit for the validation. + ValueType value_type = 2; + + // Display name of the parameter. + string display_name = 3; + + // Description. + string description = 4; + + // Regular expression in RE2 syntax used for validating the `value` of a + // `ConfigVariable`. + string validation_regex = 5; + + // Flag represents that this `ConfigVariable` must be provided for a + // connection. + bool required = 6; + + // Role grant configuration for the config variable. + RoleGrant role_grant = 7; + + // Enum options. To be populated if `ValueType` is `ENUM` + repeated EnumOption enum_options = 8; + + // Authorization code link options. To be populated if `ValueType` is + // `AUTHORIZATION_CODE` + AuthorizationCodeLink authorization_code_link = 9; + + // State of the config variable. + State state = 10; + + // Indicates if current template is part of advanced settings + bool is_advanced = 11; +} + +// Secret provides a reference to entries in Secret Manager. +message Secret { + // The resource name of the secret version in the format, + // format as: `projects/*/secrets/*/versions/*`. + string secret_version = 1; +} + +// EnumOption definition +message EnumOption { + // Id of the option. + string id = 1; + + // Display name of the option. + string display_name = 2; +} + +// ConfigVariable represents a configuration variable present in a Connection. +// or AuthConfig. +message ConfigVariable { + // Key of the config variable. + string key = 1; + + // Value type of the config variable. + oneof value { + // Value is an integer + int64 int_value = 2; + + // Value is a bool. + bool bool_value = 3; + + // Value is a string. + string string_value = 4; + + // Value is a secret. + Secret secret_value = 5; + } +} + +// This configuration defines all the Cloud IAM roles that needs to be granted +// to a particular GCP resource for the selected prinicpal like service +// account. These configurations will let UI display to customers what +// IAM roles need to be granted by them. Or these configurations can be used +// by the UI to render a 'grant' button to do the same on behalf of the user. +message RoleGrant { + // Supported Principal values. + enum Principal { + // Value type is not specified. + PRINCIPAL_UNSPECIFIED = 0; + + // Service Account used for Connector workload identity + // This is either the default service account if unspecified or Service + // Account provided by Customers through BYOSA. + CONNECTOR_SA = 1; + } + + // Resource definition + message Resource { + // Resource Type definition. + enum Type { + // Value type is not specified. + TYPE_UNSPECIFIED = 0; + + // GCP Project Resource. + GCP_PROJECT = 1; + + // Any GCP Resource which is identified uniquely by IAM. + GCP_RESOURCE = 2; + + // GCP Secret Resource. + GCP_SECRETMANAGER_SECRET = 3; + + // GCP Secret Version Resource. + GCP_SECRETMANAGER_SECRET_VERSION = 4; + } + + // Different types of resource supported. + Type type = 1; + + // Template to uniquely represent a GCP resource in a format IAM expects + // This is a template that can have references to other values provided in + // the config variable template. + string path_template = 3; + } + + // Prinicipal/Identity for whom the role need to assigned. + Principal principal = 1; + + // List of roles that need to be granted. + repeated string roles = 2; + + // Resource on which the roles needs to be granted for the principal. + Resource resource = 3; + + // Template that UI can use to provide helper text to customers. + string helper_text_template = 4; +} + +// This configuration captures the details required to render an authorization +// link for the OAuth Authorization Code Flow. +message AuthorizationCodeLink { + // The base URI the user must click to trigger the authorization code login + // flow. + string uri = 1; + + // The scopes for which the user will authorize GCP Connectors on the + // connector data source. + repeated string scopes = 2; + + // The client ID assigned to the GCP Connectors OAuth app for the connector + // data source. + string client_id = 3; + + // Whether to enable PKCE for the auth code flow. + bool enable_pkce = 4; +} + +// LaunchStage is a enum to indicate launch stage: +// PREVIEW, GA, DEPRECATED, PRIVATE_PREVIEW. +enum LaunchStage { + // LAUNCH_STAGE_UNSPECIFIED. + LAUNCH_STAGE_UNSPECIFIED = 0; + + // PREVIEW. + PREVIEW = 1; + + // GA. + GA = 2; + + // DEPRECATED. + DEPRECATED = 3; + + // PRIVATE_PREVIEW. + PRIVATE_PREVIEW = 5; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connection.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connection.proto new file mode 100644 index 00000000000..16fd258b32c --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connection.proto @@ -0,0 +1,673 @@ +// Copyright 2023 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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/connectors/v1/authconfig.proto"; +import "google/cloud/connectors/v1/common.proto"; +import "google/cloud/connectors/v1/destination_config.proto"; +import "google/cloud/connectors/v1/ssl_config.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectionProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Connection represents an instance of connector. +message Connection { + option (google.api.resource) = { + type: "connectors.googleapis.com/Connection" + pattern: "projects/{project}/locations/{location}/connections/{connection}" + }; + + // Output only. Resource name of the Connection. + // Format: projects/{project}/locations/{location}/connections/{connection} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Created time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Updated time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Description of the resource. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Connector version on which the connection is created. + // The format is: + // projects/*/locations/*/providers/*/connectors/*/versions/* + // Only global location is supported for ConnectorVersion resource. + string connector_version = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/ConnectorVersion" + } + ]; + + // Output only. Current status of the connection. + ConnectionStatus status = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Configuration for configuring the connection with an external + // system. + repeated ConfigVariable config_variables = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for establishing the connection's authentication + // with an external system. + AuthConfig auth_config = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration that indicates whether or not the Connection can be + // edited. + LockConfig lock_config = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration of the Connector's destination. Only accepted for + // Connectors that accepts user defined destination(s). + repeated DestinationConfig destination_configs = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. GCR location where the runtime image is stored. + // formatted like: gcr.io/{bucketName}/{imageName} + string image_location = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Service account needed for runtime plane to access GCP resources. + string service_account = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The name of the Service Directory service name. Used for + // Private Harpoon to resolve the ILB address. + // e.g. + // "projects/cloud-connectors-e2e-testing/locations/us-central1/namespaces/istio-system/services/istio-ingressgateway-connectors" + string service_directory = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. GCR location where the envoy image is stored. + // formatted like: gcr.io/{bucketName}/{imageName} + string envoy_image_location = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Suspended indicates if a user has suspended a connection or not. + bool suspended = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Node configuration for the connection. + NodeConfig node_config = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Ssl config of a connection + SslConfig ssl_config = 21 [(google.api.field_behavior) = OPTIONAL]; +} + +// Node configuration for the connection. +message NodeConfig { + // Minimum number of nodes in the runtime nodes. + int32 min_node_count = 1; + + // Maximum number of nodes in the runtime nodes. + int32 max_node_count = 2; +} + +// ConnectionSchemaMetadata is the singleton resource of each connection. +// It includes the entity and action names of runtime resources exposed +// by a connection backend. +message ConnectionSchemaMetadata { + option (google.api.resource) = { + type: "connectors.googleapis.com/ConnectionSchemaMetadata" + pattern: "projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata" + }; + + // State of connection runtime schema. + enum State { + // Default state. + STATE_UNSPECIFIED = 0; + + // Schema refresh is in progress. + REFRESHING = 1; + + // Schema has been updated. + UPDATED = 2; + } + + // Output only. List of entity names. + repeated string entities = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of actions. + repeated string actions = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource name. + // Format: + // projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the connection runtime schema was updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the connection runtime schema refresh was + // triggered. + google.protobuf.Timestamp refresh_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of runtime schema. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Schema of a runtime entity. +message RuntimeEntitySchema { + // Metadata of an entity field. + message Field { + // Name of the Field. + string field = 1; + + // A brief description of the Field. + string description = 2; + + // The data type of the Field. + DataType data_type = 3; + + // The following boolean field specifies if the current Field acts + // as a primary key or id if the parent is of type entity. + bool key = 4; + + // Specifies if the Field is readonly. + bool readonly = 5; + + // Specifies whether a null value is allowed. + bool nullable = 6; + + // The following field specifies the default value of the Field provided + // by the external system if a value is not provided. + google.protobuf.Value default_value = 7; + + // The following map contains fields that are not explicitly mentioned + // above,this give connectors the flexibility to add new metadata + // fields. + google.protobuf.Struct additional_details = 8; + } + + // Output only. Name of the entity. + string entity = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of fields in the entity. + repeated Field fields = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Schema of a runtime action. +message RuntimeActionSchema { + // Metadata of an input parameter. + message InputParameter { + // Name of the Parameter. + string parameter = 1; + + // A brief description of the Parameter. + string description = 2; + + // The data type of the Parameter. + DataType data_type = 3; + + // Specifies whether a null value is allowed. + bool nullable = 4; + + // The following field specifies the default value of the Parameter + // provided by the external system if a value is not provided. + google.protobuf.Value default_value = 5; + } + + // Metadata of result field. + message ResultMetadata { + // Name of the result field. + string field = 1; + + // A brief description of the field. + string description = 2; + + // The data type of the field. + DataType data_type = 3; + } + + // Output only. Name of the action. + string action = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of input parameter metadata for the action. + repeated InputParameter input_parameters = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of result field metadata. + repeated ResultMetadata result_metadata = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Determines whether or no a connection is locked. If locked, a reason must be +// specified. +message LockConfig { + // Indicates whether or not the connection is locked. + bool locked = 1; + + // Describes why a connection is locked. + string reason = 2; +} + +// Request message for ConnectorsService.ListConnections +message ListConnectionsRequest { + // Required. Parent resource of the Connection, of the form: + // `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "connectors.googleapis.com/Connection" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; + + // Filter. + string filter = 4; + + // Order by parameters. + string order_by = 5; + + // Specifies which fields of the Connection are returned in the response. + // Defaults to `BASIC` view. + ConnectionView view = 6; +} + +// Response message for ConnectorsService.ListConnections +message ListConnectionsResponse { + // Connections. + repeated Connection connections = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for ConnectorsService.GetConnection +message GetConnectionRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/connections/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connection" + } + ]; + + // Specifies which fields of the Connection are returned in the response. + // Defaults to `BASIC` view. + ConnectionView view = 2; +} + +// Request message for ConnectorsService.CreateConnection +message CreateConnectionRequest { + // Required. Parent resource of the Connection, of the form: + // `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "connectors.googleapis.com/Connection" + } + ]; + + // Required. Identifier to assign to the Connection. Must be unique within + // scope of the parent resource. + string connection_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Connection resource. + Connection connection = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ConnectorsService.UpdateConnection +message UpdateConnectionRequest { + // Required. Connection resource. + Connection connection = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. You can modify only the fields listed below. + // + // To lock/unlock a connection: + // * `lock_config` + // + // To suspend/resume a connection: + // * `suspended` + // + // To update the connection details: + // * `description` + // * `labels` + // * `connector_version` + // * `config_variables` + // * `auth_config` + // * `destination_configs` + // * `node_config` + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ConnectorsService.DeleteConnection. +message DeleteConnectionRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/connections/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connection" + } + ]; +} + +// Request message for ConnectorsService.GetConnectionSchemaMetadata. +message GetConnectionSchemaMetadataRequest { + // Required. Connection name + // Format: + // projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/ConnectionSchemaMetadata" + } + ]; +} + +// Request message for ConnectorsService.RefreshConnectionSchemaMetadata. +message RefreshConnectionSchemaMetadataRequest { + // Required. Resource name. + // Format: + // projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/ConnectionSchemaMetadata" + } + ]; +} + +// Request message for ConnectorsService.ListRuntimeEntitySchemas. +// For filter, only entity field is supported with literal equality operator. +// Accepted filter example: entity="Order" +// Wildcards are not supported in the filter currently. +message ListRuntimeEntitySchemasRequest { + // Required. Parent resource of RuntimeEntitySchema + // Format: + // projects/{project}/locations/{location}/connections/{connection} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connection" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; + + // Required. Filter + // Format: + // entity="{entityId}" + // Only entity field is supported with literal equality operator. + // Accepted filter example: entity="Order" + // Wildcards are not supported in the filter currently. + string filter = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for ConnectorsService.ListRuntimeEntitySchemas. +message ListRuntimeEntitySchemasResponse { + // Runtime entity schemas. + repeated RuntimeEntitySchema runtime_entity_schemas = 1; + + // Next page token. + string next_page_token = 2; +} + +// Request message for ConnectorsService.ListRuntimeActionSchemas. +// For filter, only action field is supported with literal equality operator. +// Accepted filter example: action="approveOrder" +// Wildcards are not supported in the filter currently. +message ListRuntimeActionSchemasRequest { + // Required. Parent resource of RuntimeActionSchema + // Format: + // projects/{project}/locations/{location}/connections/{connection} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connection" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; + + // Required. Filter + // Format: + // action="{actionId}" + // Only action field is supported with literal equality operator. + // Accepted filter example: action="CancelOrder" + // Wildcards are not supported in the filter currently. + string filter = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for ConnectorsService.ListRuntimeActionSchemas. +message ListRuntimeActionSchemasResponse { + // Runtime action schemas. + repeated RuntimeActionSchema runtime_action_schemas = 1; + + // Next page token. + string next_page_token = 2; +} + +// ConnectionStatus indicates the state of the connection. +message ConnectionStatus { + // All the possible Connection State. + enum State { + // Connection does not have a state yet. + STATE_UNSPECIFIED = 0; + + // Connection is being created. + CREATING = 1; + + // Connection is running and ready for requests. + ACTIVE = 2; + + // Connection is stopped. + INACTIVE = 3; + + // Connection is being deleted. + DELETING = 4; + + // Connection is being updated. + UPDATING = 5; + + // Connection is not running due to an error. + ERROR = 6; + + // Connection is not running due to an auth error for the Oauth2 Auth Code + // based connector. + AUTHORIZATION_REQUIRED = 7; + } + + // State. + State state = 1; + + // Description. + string description = 2; + + // Status provides detailed information for the state. + string status = 3; +} + +// All possible data types of a entity or action field. +enum DataType { + // Data type is not specified. + DATA_TYPE_UNSPECIFIED = 0; + + // DEPRECATED! Use DATA_TYPE_INTEGER. + DATA_TYPE_INT = 1 [deprecated = true]; + + // Short integer(int16) data type. + DATA_TYPE_SMALLINT = 2; + + // Double data type. + DATA_TYPE_DOUBLE = 3; + + // Date data type. + DATA_TYPE_DATE = 4; + + // DEPRECATED! Use DATA_TYPE_TIMESTAMP. + DATA_TYPE_DATETIME = 5 [deprecated = true]; + + // Time data type. + DATA_TYPE_TIME = 6; + + // DEPRECATED! Use DATA_TYPE_VARCHAR. + DATA_TYPE_STRING = 7 [deprecated = true]; + + // DEPRECATED! Use DATA_TYPE_BIGINT. + DATA_TYPE_LONG = 8 [deprecated = true]; + + // Boolean data type. + DATA_TYPE_BOOLEAN = 9; + + // Decimal data type. + DATA_TYPE_DECIMAL = 10; + + // DEPRECATED! Use DATA_TYPE_VARCHAR. + DATA_TYPE_UUID = 11 [deprecated = true]; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_BLOB = 12; + + // Bit data type. + DATA_TYPE_BIT = 13; + + // Small integer(int8) data type. + DATA_TYPE_TINYINT = 14; + + // Integer(int32) data type. + DATA_TYPE_INTEGER = 15; + + // Long integer(int64) data type. + DATA_TYPE_BIGINT = 16; + + // Float data type. + DATA_TYPE_FLOAT = 17; + + // Real data type. + DATA_TYPE_REAL = 18; + + // Numeric data type. + DATA_TYPE_NUMERIC = 19; + + // Char data type. + DATA_TYPE_CHAR = 20; + + // Varchar data type. + DATA_TYPE_VARCHAR = 21; + + // Longvarchar data type. + DATA_TYPE_LONGVARCHAR = 22; + + // Timestamp data type. + DATA_TYPE_TIMESTAMP = 23; + + // Nchar data type. + DATA_TYPE_NCHAR = 24; + + // Nvarchar data type. + DATA_TYPE_NVARCHAR = 25; + + // Longnvarchar data type. + DATA_TYPE_LONGNVARCHAR = 26; + + // Null data type. + DATA_TYPE_NULL = 27; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_OTHER = 28; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_JAVA_OBJECT = 29; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_DISTINCT = 30; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_STRUCT = 31; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_ARRAY = 32; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_CLOB = 33; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_REF = 34; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_DATALINK = 35; + + // UNSUPPORTED! Row id data type. + DATA_TYPE_ROWID = 36; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_BINARY = 37; + + // UNSUPPORTED! Variable binary data type. + DATA_TYPE_VARBINARY = 38; + + // UNSUPPORTED! Long variable binary data type. + DATA_TYPE_LONGVARBINARY = 39; + + // UNSUPPORTED! NCLOB data type. + DATA_TYPE_NCLOB = 40; + + // UNSUPPORTED! SQL XML data type is not supported. + DATA_TYPE_SQLXML = 41; + + // UNSUPPORTED! Cursor reference type is not supported. + DATA_TYPE_REF_CURSOR = 42; + + // UNSUPPORTED! Use TIME or TIMESTAMP instead. + DATA_TYPE_TIME_WITH_TIMEZONE = 43; + + // UNSUPPORTED! Use TIMESTAMP instead. + DATA_TYPE_TIMESTAMP_WITH_TIMEZONE = 44; +} + +// Enum to control which fields should be included in the response. +enum ConnectionView { + // CONNECTION_UNSPECIFIED. + CONNECTION_VIEW_UNSPECIFIED = 0; + + // Do not include runtime required configs. + BASIC = 1; + + // Include runtime required configs. + FULL = 2; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector.proto new file mode 100644 index 00000000000..0aeb357c69c --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector.proto @@ -0,0 +1,116 @@ +// Copyright 2023 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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/connectors/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectorProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Connectors indicates a specific connector type, e.x. Salesforce, SAP etc. +message Connector { + option (google.api.resource) = { + type: "connectors.googleapis.com/Connector" + pattern: "projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}" + }; + + // Output only. Resource name of the Connector. + // Format: + // projects/{project}/locations/{location}/providers/{provider}/connectors/{connector} + // Only global location is supported for Connector resource. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Created time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Updated time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Link to documentation page. + string documentation_uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Link to external page. + string external_uri = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Description of the resource. + string description = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud storage location of icons etc consumed by UI. + string web_assets_location = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Display name. + string display_name = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Flag to mark the version indicating the launch stage. + LaunchStage launch_stage = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for Connectors.GetConnector. +message GetConnectorRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/providers/*/connectors/*` + // Only global location is supported for Connector resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connector" + } + ]; +} + +// Request message for Connectors.ListConnectors. +message ListConnectorsRequest { + // Required. Parent resource of the connectors, of the form: + // `projects/*/locations/*/providers/*` + // Only global location is supported for Connector resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Provider" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; +} + +// Response message for Connectors.ListConnectors. +message ListConnectorsResponse { + // A list of connectors. + repeated Connector connectors = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector_version.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector_version.proto new file mode 100644 index 00000000000..00c8c603627 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector_version.proto @@ -0,0 +1,226 @@ +// Copyright 2023 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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/connectors/v1/authconfig.proto"; +import "google/cloud/connectors/v1/common.proto"; +import "google/cloud/connectors/v1/ssl_config.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectorVersionProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// ConnectorVersion indicates a specific version of a connector. +message ConnectorVersion { + option (google.api.resource) = { + type: "connectors.googleapis.com/ConnectorVersion" + pattern: "projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}/versions/{version}" + }; + + // Output only. Resource name of the Version. + // Format: + // projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}/versions/{version} + // Only global location is supported for Connector resource. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Created time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Updated time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Flag to mark the version indicating the launch stage. + LaunchStage launch_stage = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ReleaseVersion of the connector, for example: "1.0.1-alpha". + string release_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of auth configs supported by the Connector Version. + repeated AuthConfigTemplate auth_config_templates = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of config variables needed to create a connection. + repeated ConfigVariableTemplate config_variable_templates = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about the runtime features supported by the + // Connector. + SupportedRuntimeFeatures supported_runtime_features = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Display name. + string display_name = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Configuration for Egress Control. + EgressControlConfig egress_control_config = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Role grant configurations for this connector version. + repeated RoleGrant role_grants = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Role grant configuration for this config variable. It will be + // DEPRECATED soon. + RoleGrant role_grant = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Ssl configuration supported by the Connector. + SslConfigTemplate ssl_config_template = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for Connectors.GetConnectorVersion. +message GetConnectorVersionRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/providers/*/connectors/*/versions/*` + // Only global location is supported for ConnectorVersion resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/ConnectorVersion" + } + ]; + + // Specifies which fields of the ConnectorVersion are returned in the + // response. Defaults to `CUSTOMER` view. + ConnectorVersionView view = 2; +} + +// Request message for Connectors.ListConnectorVersions. +message ListConnectorVersionsRequest { + // Required. Parent resource of the connectors, of the form: + // `projects/*/locations/*/providers/*/connectors/*` + // Only global location is supported for ConnectorVersion resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connector" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; + + // Specifies which fields of the ConnectorVersion are returned in the + // response. Defaults to `BASIC` view. + ConnectorVersionView view = 4; +} + +// Response message for Connectors.ListConnectorVersions. +message ListConnectorVersionsResponse { + // A list of connector versions. + repeated ConnectorVersion connector_versions = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Supported runtime features of a connector version. This is passed to the +// management layer to add a new connector version by the connector developer. +// Details about how this proto is passed to the management layer is covered in +// this doc - go/runtime-manifest. +message SupportedRuntimeFeatures { + // Specifies if the connector supports entity apis like 'createEntity'. + bool entity_apis = 1; + + // Specifies if the connector supports action apis like 'executeAction'. + bool action_apis = 2; + + // Specifies if the connector supports 'ExecuteSqlQuery' operation. + bool sql_query = 3; +} + +// Egress control config for connector runtime. These configurations define the +// rules to identify which outbound domains/hosts needs to be whitelisted. It +// may be a static information for a particular connector version or it is +// derived from the configurations provided by the customer in Connection +// resource. +message EgressControlConfig { + oneof oneof_backends { + // Static Comma separated backends which are common for all Connection + // resources. Supported formats for each backend are host:port or just + // host (host can be ip address or domain name). + string backends = 1; + + // Extractions Rules to extract the backends from customer provided + // configuration. + ExtractionRules extraction_rules = 2; + } +} + +// Extraction Rules to identity the backends from customer provided +// configuration in Connection resource. +message ExtractionRules { + // Collection of Extraction Rule. + repeated ExtractionRule extraction_rule = 1; +} + +// Extraction Rule. +message ExtractionRule { + // Source to extract the backend from. + message Source { + // Type of the source. + SourceType source_type = 1; + + // Field identifier. For example config vaiable name. + string field_id = 2; + } + + // Supported Source types for extraction. + enum SourceType { + // Default SOURCE. + SOURCE_TYPE_UNSPECIFIED = 0; + + // Config Variable source type. + CONFIG_VARIABLE = 1; + } + + // Source on which the rule is applied. + Source source = 1; + + // Regex used to extract backend details from source. If empty, whole source + // value will be used. + string extraction_regex = 2; +} + +// Enum to control which fields should be included in the response. +enum ConnectorVersionView { + // CONNECTOR_VERSION_VIEW_UNSPECIFIED. + CONNECTOR_VERSION_VIEW_UNSPECIFIED = 0; + + // Do not include role grant configs. + CONNECTOR_VERSION_VIEW_BASIC = 1; + + // Include role grant configs. + CONNECTOR_VERSION_VIEW_FULL = 2; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connectors_service.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connectors_service.proto new file mode 100644 index 00000000000..2f1d3e03365 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connectors_service.proto @@ -0,0 +1,209 @@ +// Copyright 2023 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.connectors.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/connectors/v1/common.proto"; +import "google/cloud/connectors/v1/connection.proto"; +import "google/cloud/connectors/v1/connector.proto"; +import "google/cloud/connectors/v1/connector_version.proto"; +import "google/cloud/connectors/v1/provider.proto"; +import "google/cloud/connectors/v1/runtime.proto"; +import "google/cloud/connectors/v1/settings.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectorsServiceProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Connectors is the interface for managing Connectors. +service Connectors { + option (google.api.default_host) = "connectors.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Connections in a given project and location. + rpc ListConnections(ListConnectionsRequest) + returns (ListConnectionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/connections" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Connection. + rpc GetConnection(GetConnectionRequest) returns (Connection) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/connections/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Connection in a given project and location. + rpc CreateConnection(CreateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/connections" + body: "connection" + }; + option (google.api.method_signature) = "parent,connection,connection_id"; + option (google.longrunning.operation_info) = { + response_type: "Connection" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Connection. + rpc UpdateConnection(UpdateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{connection.name=projects/*/locations/*/connections/*}" + body: "connection" + }; + option (google.api.method_signature) = "connection,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Connection" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Connection. + rpc DeleteConnection(DeleteConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/connections/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists Providers in a given project and location. + rpc ListProviders(ListProvidersRequest) returns (ListProvidersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/providers" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a provider. + rpc GetProvider(GetProviderRequest) returns (Provider) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/providers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Connectors in a given project and location. + rpc ListConnectors(ListConnectorsRequest) returns (ListConnectorsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/providers/*}/connectors" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Connector. + rpc GetConnector(GetConnectorRequest) returns (Connector) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/providers/*/connectors/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Connector Versions in a given project and location. + rpc ListConnectorVersions(ListConnectorVersionsRequest) + returns (ListConnectorVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/providers/*/connectors/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single connector version. + rpc GetConnectorVersion(GetConnectorVersionRequest) + returns (ConnectorVersion) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/providers/*/connectors/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets schema metadata of a connection. + // SchemaMetadata is a singleton resource for each connection. + rpc GetConnectionSchemaMetadata(GetConnectionSchemaMetadataRequest) + returns (ConnectionSchemaMetadata) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}" + }; + option (google.api.method_signature) = "name"; + } + + // Refresh runtime schema of a connection. + rpc RefreshConnectionSchemaMetadata(RefreshConnectionSchemaMetadataRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}:refresh" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "ConnectionSchemaMetadata" + metadata_type: "OperationMetadata" + }; + } + + // List schema of a runtime entities filtered by entity name. + rpc ListRuntimeEntitySchemas(ListRuntimeEntitySchemasRequest) + returns (ListRuntimeEntitySchemasResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/connections/*}/runtimeEntitySchemas" + }; + option (google.api.method_signature) = "parent"; + } + + // List schema of a runtime actions filtered by action name. + rpc ListRuntimeActionSchemas(ListRuntimeActionSchemasRequest) + returns (ListRuntimeActionSchemasResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/connections/*}/runtimeActionSchemas" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the runtimeConfig of a location. + // RuntimeConfig is a singleton resource for each location. + rpc GetRuntimeConfig(GetRuntimeConfigRequest) returns (RuntimeConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/runtimeConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // GetGlobalSettings gets settings of a project. + // GlobalSettings is a singleton resource. + rpc GetGlobalSettings(GetGlobalSettingsRequest) returns (Settings) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/settings}" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/destination_config.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/destination_config.proto new file mode 100644 index 00000000000..b8a2665884d --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/destination_config.proto @@ -0,0 +1,43 @@ +// Copyright 2023 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.connectors.v1; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; + +// Define the Connectors target endpoint. +message DestinationConfig { + // The key is the destination identifier that is supported by the Connector. + string key = 1; + + // The destinations for the key. + repeated Destination destinations = 2; +} + +message Destination { + oneof destination { + // PSC service attachments. + // Format: projects/*/regions/*/serviceAttachments/* + string service_attachment = 1; + + // For publicly routable host. + string host = 2; + } + + // The port is the target port number that is accepted by the destination. + int32 port = 3; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/provider.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/provider.proto new file mode 100644 index 00000000000..6f908a45614 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/provider.proto @@ -0,0 +1,115 @@ +// Copyright 2023 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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/connectors/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "ProviderProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Provider indicates the owner who provides the connectors. +message Provider { + option (google.api.resource) = { + type: "connectors.googleapis.com/Provider" + pattern: "projects/{project}/locations/{location}/providers/{provider}" + }; + + // Output only. Resource name of the Provider. + // Format: projects/{project}/locations/{location}/providers/{provider} + // Only global location is supported for Provider resource. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Created time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Updated time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Link to documentation page. + string documentation_uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Link to external page. + string external_uri = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Description of the resource. + string description = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud storage location of icons etc consumed by UI. + string web_assets_location = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Display name. + string display_name = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Flag to mark the version indicating the launch stage. + LaunchStage launch_stage = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for Connectors.GetProvider. +message GetProviderRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/providers/*` + // Only global location is supported for Provider resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Provider" + } + ]; +} + +// Request message for Connectors.ListProviders. +message ListProvidersRequest { + // Required. Parent resource of the API, of the form: + // `projects/*/locations/*` + // Only global location is supported for Provider resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "connectors.googleapis.com/Provider" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; +} + +// Response message for Connectors.ListProviders. +message ListProvidersResponse { + // A list of providers. + repeated Provider providers = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/runtime.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/runtime.proto new file mode 100644 index 00000000000..80408246223 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/runtime.proto @@ -0,0 +1,110 @@ +// Copyright 2023 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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "RuntimeProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Request message for Connectors.GetRuntimeConfig. +message GetRuntimeConfigRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/runtimeConfig` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/RuntimeConfig" + } + ]; +} + +// RuntimeConfig is the singleton resource of each location. +// It includes generic resource configs consumed by control plane and runtime +// plane like: pub/sub topic/subscription resource name, Cloud Storage location +// storing schema etc. +message RuntimeConfig { + option (google.api.resource) = { + type: "connectors.googleapis.com/RuntimeConfig" + pattern: "projects/{project}/locations/{location}/runtimeConfig" + }; + + // State of the location. + enum State { + // STATE_UNSPECIFIED. + STATE_UNSPECIFIED = 0; + + // INACTIVE. + INACTIVE = 1 [deprecated = true]; + + // ACTIVATING. + ACTIVATING = 2 [deprecated = true]; + + // ACTIVE. + ACTIVE = 3; + + // CREATING. + CREATING = 4; + + // DELETING. + DELETING = 5; + + // UPDATING. + UPDATING = 6; + } + + // Output only. location_id of the runtime location. E.g. "us-west1". + string location_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pub/Sub topic for connd to send message. + // E.g. projects/{project-id}/topics/{topic-id} + string connd_topic = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pub/Sub subscription for connd to receive message. + // E.g. projects/{project-id}/subscriptions/{topic-id} + string connd_subscription = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pub/Sub topic for control plne to send message. + // communication. + // E.g. projects/{project-id}/topics/{topic-id} + string control_plane_topic = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pub/Sub subscription for control plane to receive message. + // E.g. projects/{project-id}/subscriptions/{topic-id} + string control_plane_subscription = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The endpoint of the connectors runtime ingress. + string runtime_endpoint = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of the location. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Cloud Storage bucket that stores connector's schema + // reports. + string schema_gcs_bucket = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the Service Directory service name. + string service_directory = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the runtimeConfig resource. + // Format: projects/{project}/locations/{location}/runtimeConfig + string name = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/settings.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/settings.proto new file mode 100644 index 00000000000..31879187d72 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/settings.proto @@ -0,0 +1,54 @@ +// Copyright 2023 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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "SettingsProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Request for [GetGlobalSettingsRequest]. +message GetGlobalSettingsRequest { + // Required. The resource name of the Settings. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Settings" + } + ]; +} + +// Global Settings details. +message Settings { + option (google.api.resource) = { + type: "connectors.googleapis.com/Settings" + pattern: "projects/{project}/locations/global/settings" + }; + + // Output only. Resource name of the Connection. + // Format: projects/{project}/locations/global/settings} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Flag indicates whether vpc-sc is enabled. + bool vpcsc = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Flag indicates if user is in PayG model + bool payg = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/ssl_config.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/ssl_config.proto new file mode 100644 index 00000000000..cc4ae370701 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/ssl_config.proto @@ -0,0 +1,109 @@ +// Copyright 2023 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.connectors.v1; + +import "google/cloud/connectors/v1/common.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "SslConfigProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Ssl config details of a connector version +message SslConfigTemplate { + // Controls the ssl type for the given connector version + SslType ssl_type = 1; + + // Boolean for determining if the connector version mandates TLS. + bool is_tls_mandatory = 2; + + // List of supported Server Cert Types + repeated CertType server_cert_type = 3; + + // List of supported Client Cert Types + repeated CertType client_cert_type = 4; + + // Any additional fields that need to be rendered + repeated ConfigVariableTemplate additional_variables = 5; +} + +// SSL Configuration of a connection +message SslConfig { + // Enum for Ttust Model + enum TrustModel { + // Public Trust Model. Takes the Default Java trust store. + PUBLIC = 0; + + // Private Trust Model. Takes custom/private trust store. + PRIVATE = 1; + + // Insecure Trust Model. Accept all certificates. + INSECURE = 2; + } + + // Controls the ssl type for the given connector version. + SslType type = 1; + + // Trust Model of the SSL connection + TrustModel trust_model = 2; + + // Private Server Certificate. Needs to be specified if trust model is + // `PRIVATE`. + Secret private_server_certificate = 3; + + // Client Certificate + Secret client_certificate = 4; + + // Client Private Key + Secret client_private_key = 5; + + // Secret containing the passphrase protecting the Client Private Key + Secret client_private_key_pass = 6; + + // Type of Server Cert (PEM/JKS/.. etc.) + CertType server_cert_type = 7; + + // Type of Client Cert (PEM/JKS/.. etc.) + CertType client_cert_type = 8; + + // Bool for enabling SSL + bool use_ssl = 9; + + // Additional SSL related field values + repeated ConfigVariable additional_variables = 10; +} + +// Enum for controlling the SSL Type (TLS/MTLS) +enum SslType { + // No SSL configuration required. + SSL_TYPE_UNSPECIFIED = 0; + + // TLS Handshake + TLS = 1; + + // mutual TLS (MTLS) Handshake + MTLS = 2; +} + +// Enum for Cert Types +enum CertType { + // Cert type unspecified. + CERT_TYPE_UNSPECIFIED = 0; + + // Privacy Enhanced Mail (PEM) Type + PEM = 1; +} diff --git a/packages/google-cloud-connectors/protos/protos.d.ts b/packages/google-cloud-connectors/protos/protos.d.ts new file mode 100644 index 00000000000..af4d4ceff65 --- /dev/null +++ b/packages/google-cloud-connectors/protos/protos.d.ts @@ -0,0 +1,15119 @@ +// Copyright 2023 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 type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace connectors. */ + namespace connectors { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an AuthConfig. */ + interface IAuthConfig { + + /** AuthConfig authType */ + authType?: (google.cloud.connectors.v1.AuthType|keyof typeof google.cloud.connectors.v1.AuthType|null); + + /** AuthConfig userPassword */ + userPassword?: (google.cloud.connectors.v1.AuthConfig.IUserPassword|null); + + /** AuthConfig oauth2JwtBearer */ + oauth2JwtBearer?: (google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer|null); + + /** AuthConfig oauth2ClientCredentials */ + oauth2ClientCredentials?: (google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials|null); + + /** AuthConfig sshPublicKey */ + sshPublicKey?: (google.cloud.connectors.v1.AuthConfig.ISshPublicKey|null); + + /** AuthConfig additionalVariables */ + additionalVariables?: (google.cloud.connectors.v1.IConfigVariable[]|null); + } + + /** Represents an AuthConfig. */ + class AuthConfig implements IAuthConfig { + + /** + * Constructs a new AuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IAuthConfig); + + /** AuthConfig authType. */ + public authType: (google.cloud.connectors.v1.AuthType|keyof typeof google.cloud.connectors.v1.AuthType); + + /** AuthConfig userPassword. */ + public userPassword?: (google.cloud.connectors.v1.AuthConfig.IUserPassword|null); + + /** AuthConfig oauth2JwtBearer. */ + public oauth2JwtBearer?: (google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer|null); + + /** AuthConfig oauth2ClientCredentials. */ + public oauth2ClientCredentials?: (google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials|null); + + /** AuthConfig sshPublicKey. */ + public sshPublicKey?: (google.cloud.connectors.v1.AuthConfig.ISshPublicKey|null); + + /** AuthConfig additionalVariables. */ + public additionalVariables: google.cloud.connectors.v1.IConfigVariable[]; + + /** AuthConfig type. */ + public type?: ("userPassword"|"oauth2JwtBearer"|"oauth2ClientCredentials"|"sshPublicKey"); + + /** + * Creates a new AuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.IAuthConfig): google.cloud.connectors.v1.AuthConfig; + + /** + * Encodes the specified AuthConfig message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.verify|verify} messages. + * @param message AuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.verify|verify} messages. + * @param message AuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthConfig + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig; + + /** + * Decodes an AuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthConfig + * @throws {Error} If the payload 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.connectors.v1.AuthConfig; + + /** + * Verifies an AuthConfig message. + * @param message Plain 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 AuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig; + + /** + * Creates a plain object from an AuthConfig message. Also converts values to other types if specified. + * @param message AuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuthConfig { + + /** Properties of a UserPassword. */ + interface IUserPassword { + + /** UserPassword username */ + username?: (string|null); + + /** UserPassword password */ + password?: (google.cloud.connectors.v1.ISecret|null); + } + + /** Represents a UserPassword. */ + class UserPassword implements IUserPassword { + + /** + * Constructs a new UserPassword. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.AuthConfig.IUserPassword); + + /** UserPassword username. */ + public username: string; + + /** UserPassword password. */ + public password?: (google.cloud.connectors.v1.ISecret|null); + + /** + * Creates a new UserPassword instance using the specified properties. + * @param [properties] Properties to set + * @returns UserPassword instance + */ + public static create(properties?: google.cloud.connectors.v1.AuthConfig.IUserPassword): google.cloud.connectors.v1.AuthConfig.UserPassword; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.AuthConfig.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.AuthConfig.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserPassword + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig.UserPassword; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserPassword + * @throws {Error} If the payload 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.connectors.v1.AuthConfig.UserPassword; + + /** + * Verifies a UserPassword message. + * @param message Plain 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 UserPassword message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserPassword + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig.UserPassword; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @param message UserPassword + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserPassword to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserPassword + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Oauth2JwtBearer. */ + interface IOauth2JwtBearer { + + /** Oauth2JwtBearer clientKey */ + clientKey?: (google.cloud.connectors.v1.ISecret|null); + + /** Oauth2JwtBearer jwtClaims */ + jwtClaims?: (google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims|null); + } + + /** Represents an Oauth2JwtBearer. */ + class Oauth2JwtBearer implements IOauth2JwtBearer { + + /** + * Constructs a new Oauth2JwtBearer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer); + + /** Oauth2JwtBearer clientKey. */ + public clientKey?: (google.cloud.connectors.v1.ISecret|null); + + /** Oauth2JwtBearer jwtClaims. */ + public jwtClaims?: (google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims|null); + + /** + * Creates a new Oauth2JwtBearer instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2JwtBearer instance + */ + public static create(properties?: google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer): google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer; + + /** + * Encodes the specified Oauth2JwtBearer message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.verify|verify} messages. + * @param message Oauth2JwtBearer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2JwtBearer message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.verify|verify} messages. + * @param message Oauth2JwtBearer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2JwtBearer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2JwtBearer + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig.Oauth2JwtBearer; + + /** + * Decodes an Oauth2JwtBearer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2JwtBearer + * @throws {Error} If the payload 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.connectors.v1.AuthConfig.Oauth2JwtBearer; + + /** + * Verifies an Oauth2JwtBearer message. + * @param message Plain 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 Oauth2JwtBearer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2JwtBearer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer; + + /** + * Creates a plain object from an Oauth2JwtBearer message. Also converts values to other types if specified. + * @param message Oauth2JwtBearer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2JwtBearer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2JwtBearer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Oauth2JwtBearer { + + /** Properties of a JwtClaims. */ + interface IJwtClaims { + + /** JwtClaims issuer */ + issuer?: (string|null); + + /** JwtClaims subject */ + subject?: (string|null); + + /** JwtClaims audience */ + audience?: (string|null); + } + + /** Represents a JwtClaims. */ + class JwtClaims implements IJwtClaims { + + /** + * Constructs a new JwtClaims. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims); + + /** JwtClaims issuer. */ + public issuer: string; + + /** JwtClaims subject. */ + public subject: string; + + /** JwtClaims audience. */ + public audience: string; + + /** + * Creates a new JwtClaims instance using the specified properties. + * @param [properties] Properties to set + * @returns JwtClaims instance + */ + public static create(properties?: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims): google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims; + + /** + * Encodes the specified JwtClaims message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.verify|verify} messages. + * @param message JwtClaims message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JwtClaims message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.verify|verify} messages. + * @param message JwtClaims message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JwtClaims message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JwtClaims + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims; + + /** + * Decodes a JwtClaims message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JwtClaims + * @throws {Error} If the payload 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.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims; + + /** + * Verifies a JwtClaims message. + * @param message Plain 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 JwtClaims message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JwtClaims + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims; + + /** + * Creates a plain object from a JwtClaims message. Also converts values to other types if specified. + * @param message JwtClaims + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JwtClaims to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JwtClaims + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Oauth2ClientCredentials. */ + interface IOauth2ClientCredentials { + + /** Oauth2ClientCredentials clientId */ + clientId?: (string|null); + + /** Oauth2ClientCredentials clientSecret */ + clientSecret?: (google.cloud.connectors.v1.ISecret|null); + } + + /** Represents an Oauth2ClientCredentials. */ + class Oauth2ClientCredentials implements IOauth2ClientCredentials { + + /** + * Constructs a new Oauth2ClientCredentials. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials); + + /** Oauth2ClientCredentials clientId. */ + public clientId: string; + + /** Oauth2ClientCredentials clientSecret. */ + public clientSecret?: (google.cloud.connectors.v1.ISecret|null); + + /** + * Creates a new Oauth2ClientCredentials instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2ClientCredentials instance + */ + public static create(properties?: google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials): google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials; + + /** + * Encodes the specified Oauth2ClientCredentials message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.verify|verify} messages. + * @param message Oauth2ClientCredentials message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2ClientCredentials message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.verify|verify} messages. + * @param message Oauth2ClientCredentials message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2ClientCredentials message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2ClientCredentials + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig.Oauth2ClientCredentials; + + /** + * Decodes an Oauth2ClientCredentials message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2ClientCredentials + * @throws {Error} If the payload 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.connectors.v1.AuthConfig.Oauth2ClientCredentials; + + /** + * Verifies an Oauth2ClientCredentials message. + * @param message Plain 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 Oauth2ClientCredentials message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2ClientCredentials + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials; + + /** + * Creates a plain object from an Oauth2ClientCredentials message. Also converts values to other types if specified. + * @param message Oauth2ClientCredentials + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2ClientCredentials to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2ClientCredentials + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SshPublicKey. */ + interface ISshPublicKey { + + /** SshPublicKey username */ + username?: (string|null); + + /** SshPublicKey sshClientCert */ + sshClientCert?: (google.cloud.connectors.v1.ISecret|null); + + /** SshPublicKey certType */ + certType?: (string|null); + + /** SshPublicKey sshClientCertPass */ + sshClientCertPass?: (google.cloud.connectors.v1.ISecret|null); + } + + /** Represents a SshPublicKey. */ + class SshPublicKey implements ISshPublicKey { + + /** + * Constructs a new SshPublicKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.AuthConfig.ISshPublicKey); + + /** SshPublicKey username. */ + public username: string; + + /** SshPublicKey sshClientCert. */ + public sshClientCert?: (google.cloud.connectors.v1.ISecret|null); + + /** SshPublicKey certType. */ + public certType: string; + + /** SshPublicKey sshClientCertPass. */ + public sshClientCertPass?: (google.cloud.connectors.v1.ISecret|null); + + /** + * Creates a new SshPublicKey instance using the specified properties. + * @param [properties] Properties to set + * @returns SshPublicKey instance + */ + public static create(properties?: google.cloud.connectors.v1.AuthConfig.ISshPublicKey): google.cloud.connectors.v1.AuthConfig.SshPublicKey; + + /** + * Encodes the specified SshPublicKey message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.SshPublicKey.verify|verify} messages. + * @param message SshPublicKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.AuthConfig.ISshPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SshPublicKey message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.SshPublicKey.verify|verify} messages. + * @param message SshPublicKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.AuthConfig.ISshPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SshPublicKey + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig.SshPublicKey; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SshPublicKey + * @throws {Error} If the payload 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.connectors.v1.AuthConfig.SshPublicKey; + + /** + * Verifies a SshPublicKey message. + * @param message Plain 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 SshPublicKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SshPublicKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig.SshPublicKey; + + /** + * Creates a plain object from a SshPublicKey message. Also converts values to other types if specified. + * @param message SshPublicKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig.SshPublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SshPublicKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SshPublicKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AuthConfigTemplate. */ + interface IAuthConfigTemplate { + + /** AuthConfigTemplate authType */ + authType?: (google.cloud.connectors.v1.AuthType|keyof typeof google.cloud.connectors.v1.AuthType|null); + + /** AuthConfigTemplate configVariableTemplates */ + configVariableTemplates?: (google.cloud.connectors.v1.IConfigVariableTemplate[]|null); + + /** AuthConfigTemplate displayName */ + displayName?: (string|null); + + /** AuthConfigTemplate description */ + description?: (string|null); + } + + /** Represents an AuthConfigTemplate. */ + class AuthConfigTemplate implements IAuthConfigTemplate { + + /** + * Constructs a new AuthConfigTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IAuthConfigTemplate); + + /** AuthConfigTemplate authType. */ + public authType: (google.cloud.connectors.v1.AuthType|keyof typeof google.cloud.connectors.v1.AuthType); + + /** AuthConfigTemplate configVariableTemplates. */ + public configVariableTemplates: google.cloud.connectors.v1.IConfigVariableTemplate[]; + + /** AuthConfigTemplate displayName. */ + public displayName: string; + + /** AuthConfigTemplate description. */ + public description: string; + + /** + * Creates a new AuthConfigTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthConfigTemplate instance + */ + public static create(properties?: google.cloud.connectors.v1.IAuthConfigTemplate): google.cloud.connectors.v1.AuthConfigTemplate; + + /** + * Encodes the specified AuthConfigTemplate message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfigTemplate.verify|verify} messages. + * @param message AuthConfigTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IAuthConfigTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthConfigTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfigTemplate.verify|verify} messages. + * @param message AuthConfigTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IAuthConfigTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthConfigTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthConfigTemplate + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfigTemplate; + + /** + * Decodes an AuthConfigTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthConfigTemplate + * @throws {Error} If the payload 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.connectors.v1.AuthConfigTemplate; + + /** + * Verifies an AuthConfigTemplate message. + * @param message Plain 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 AuthConfigTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthConfigTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfigTemplate; + + /** + * Creates a plain object from an AuthConfigTemplate message. Also converts values to other types if specified. + * @param message AuthConfigTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfigTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthConfigTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthConfigTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** AuthType enum. */ + enum AuthType { + AUTH_TYPE_UNSPECIFIED = 0, + USER_PASSWORD = 1, + OAUTH2_JWT_BEARER = 2, + OAUTH2_CLIENT_CREDENTIALS = 3, + SSH_PUBLIC_KEY = 4, + OAUTH2_AUTH_CODE_FLOW = 5 + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.connectors.v1.IOperationMetadata): google.cloud.connectors.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.connectors.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.connectors.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.connectors.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfigVariableTemplate. */ + interface IConfigVariableTemplate { + + /** ConfigVariableTemplate key */ + key?: (string|null); + + /** ConfigVariableTemplate valueType */ + valueType?: (google.cloud.connectors.v1.ConfigVariableTemplate.ValueType|keyof typeof google.cloud.connectors.v1.ConfigVariableTemplate.ValueType|null); + + /** ConfigVariableTemplate displayName */ + displayName?: (string|null); + + /** ConfigVariableTemplate description */ + description?: (string|null); + + /** ConfigVariableTemplate validationRegex */ + validationRegex?: (string|null); + + /** ConfigVariableTemplate required */ + required?: (boolean|null); + + /** ConfigVariableTemplate roleGrant */ + roleGrant?: (google.cloud.connectors.v1.IRoleGrant|null); + + /** ConfigVariableTemplate enumOptions */ + enumOptions?: (google.cloud.connectors.v1.IEnumOption[]|null); + + /** ConfigVariableTemplate authorizationCodeLink */ + authorizationCodeLink?: (google.cloud.connectors.v1.IAuthorizationCodeLink|null); + + /** ConfigVariableTemplate state */ + state?: (google.cloud.connectors.v1.ConfigVariableTemplate.State|keyof typeof google.cloud.connectors.v1.ConfigVariableTemplate.State|null); + + /** ConfigVariableTemplate isAdvanced */ + isAdvanced?: (boolean|null); + } + + /** Represents a ConfigVariableTemplate. */ + class ConfigVariableTemplate implements IConfigVariableTemplate { + + /** + * Constructs a new ConfigVariableTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConfigVariableTemplate); + + /** ConfigVariableTemplate key. */ + public key: string; + + /** ConfigVariableTemplate valueType. */ + public valueType: (google.cloud.connectors.v1.ConfigVariableTemplate.ValueType|keyof typeof google.cloud.connectors.v1.ConfigVariableTemplate.ValueType); + + /** ConfigVariableTemplate displayName. */ + public displayName: string; + + /** ConfigVariableTemplate description. */ + public description: string; + + /** ConfigVariableTemplate validationRegex. */ + public validationRegex: string; + + /** ConfigVariableTemplate required. */ + public required: boolean; + + /** ConfigVariableTemplate roleGrant. */ + public roleGrant?: (google.cloud.connectors.v1.IRoleGrant|null); + + /** ConfigVariableTemplate enumOptions. */ + public enumOptions: google.cloud.connectors.v1.IEnumOption[]; + + /** ConfigVariableTemplate authorizationCodeLink. */ + public authorizationCodeLink?: (google.cloud.connectors.v1.IAuthorizationCodeLink|null); + + /** ConfigVariableTemplate state. */ + public state: (google.cloud.connectors.v1.ConfigVariableTemplate.State|keyof typeof google.cloud.connectors.v1.ConfigVariableTemplate.State); + + /** ConfigVariableTemplate isAdvanced. */ + public isAdvanced: boolean; + + /** + * Creates a new ConfigVariableTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfigVariableTemplate instance + */ + public static create(properties?: google.cloud.connectors.v1.IConfigVariableTemplate): google.cloud.connectors.v1.ConfigVariableTemplate; + + /** + * Encodes the specified ConfigVariableTemplate message. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariableTemplate.verify|verify} messages. + * @param message ConfigVariableTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConfigVariableTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfigVariableTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariableTemplate.verify|verify} messages. + * @param message ConfigVariableTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConfigVariableTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfigVariableTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfigVariableTemplate + * @throws {Error} If the payload is not 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.connectors.v1.ConfigVariableTemplate; + + /** + * Decodes a ConfigVariableTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfigVariableTemplate + * @throws {Error} If the payload 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.connectors.v1.ConfigVariableTemplate; + + /** + * Verifies a ConfigVariableTemplate message. + * @param message Plain 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 ConfigVariableTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfigVariableTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ConfigVariableTemplate; + + /** + * Creates a plain object from a ConfigVariableTemplate message. Also converts values to other types if specified. + * @param message ConfigVariableTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ConfigVariableTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfigVariableTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfigVariableTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConfigVariableTemplate { + + /** ValueType enum. */ + enum ValueType { + VALUE_TYPE_UNSPECIFIED = 0, + STRING = 1, + INT = 2, + BOOL = 3, + SECRET = 4, + ENUM = 5, + AUTHORIZATION_CODE = 6 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + DEPRECATED = 2 + } + } + + /** Properties of a Secret. */ + interface ISecret { + + /** Secret secretVersion */ + secretVersion?: (string|null); + } + + /** Represents a Secret. */ + class Secret implements ISecret { + + /** + * Constructs a new Secret. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ISecret); + + /** Secret secretVersion. */ + public secretVersion: string; + + /** + * Creates a new Secret instance using the specified properties. + * @param [properties] Properties to set + * @returns Secret instance + */ + public static create(properties?: google.cloud.connectors.v1.ISecret): google.cloud.connectors.v1.Secret; + + /** + * Encodes the specified Secret message. Does not implicitly {@link google.cloud.connectors.v1.Secret.verify|verify} messages. + * @param message Secret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ISecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Secret.verify|verify} messages. + * @param message Secret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ISecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Secret message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Secret + * @throws {Error} If the payload is not 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.connectors.v1.Secret; + + /** + * Decodes a Secret message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Secret + * @throws {Error} If the payload 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.connectors.v1.Secret; + + /** + * Verifies a Secret message. + * @param message Plain 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 Secret message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Secret + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Secret; + + /** + * Creates a plain object from a Secret message. Also converts values to other types if specified. + * @param message Secret + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Secret, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Secret to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Secret + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOption. */ + interface IEnumOption { + + /** EnumOption id */ + id?: (string|null); + + /** EnumOption displayName */ + displayName?: (string|null); + } + + /** Represents an EnumOption. */ + class EnumOption implements IEnumOption { + + /** + * Constructs a new EnumOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IEnumOption); + + /** EnumOption id. */ + public id: string; + + /** EnumOption displayName. */ + public displayName: string; + + /** + * Creates a new EnumOption instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOption instance + */ + public static create(properties?: google.cloud.connectors.v1.IEnumOption): google.cloud.connectors.v1.EnumOption; + + /** + * Encodes the specified EnumOption message. Does not implicitly {@link google.cloud.connectors.v1.EnumOption.verify|verify} messages. + * @param message EnumOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IEnumOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOption message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.EnumOption.verify|verify} messages. + * @param message EnumOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IEnumOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOption + * @throws {Error} If the payload is not 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.connectors.v1.EnumOption; + + /** + * Decodes an EnumOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOption + * @throws {Error} If the payload 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.connectors.v1.EnumOption; + + /** + * Verifies an EnumOption message. + * @param message Plain 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 EnumOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.EnumOption; + + /** + * Creates a plain object from an EnumOption message. Also converts values to other types if specified. + * @param message EnumOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.EnumOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfigVariable. */ + interface IConfigVariable { + + /** ConfigVariable key */ + key?: (string|null); + + /** ConfigVariable intValue */ + intValue?: (number|Long|string|null); + + /** ConfigVariable boolValue */ + boolValue?: (boolean|null); + + /** ConfigVariable stringValue */ + stringValue?: (string|null); + + /** ConfigVariable secretValue */ + secretValue?: (google.cloud.connectors.v1.ISecret|null); + } + + /** Represents a ConfigVariable. */ + class ConfigVariable implements IConfigVariable { + + /** + * Constructs a new ConfigVariable. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConfigVariable); + + /** ConfigVariable key. */ + public key: string; + + /** ConfigVariable intValue. */ + public intValue?: (number|Long|string|null); + + /** ConfigVariable boolValue. */ + public boolValue?: (boolean|null); + + /** ConfigVariable stringValue. */ + public stringValue?: (string|null); + + /** ConfigVariable secretValue. */ + public secretValue?: (google.cloud.connectors.v1.ISecret|null); + + /** ConfigVariable value. */ + public value?: ("intValue"|"boolValue"|"stringValue"|"secretValue"); + + /** + * Creates a new ConfigVariable instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfigVariable instance + */ + public static create(properties?: google.cloud.connectors.v1.IConfigVariable): google.cloud.connectors.v1.ConfigVariable; + + /** + * Encodes the specified ConfigVariable message. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariable.verify|verify} messages. + * @param message ConfigVariable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConfigVariable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfigVariable message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariable.verify|verify} messages. + * @param message ConfigVariable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConfigVariable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfigVariable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfigVariable + * @throws {Error} If the payload is not 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.connectors.v1.ConfigVariable; + + /** + * Decodes a ConfigVariable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfigVariable + * @throws {Error} If the payload 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.connectors.v1.ConfigVariable; + + /** + * Verifies a ConfigVariable message. + * @param message Plain 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 ConfigVariable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfigVariable + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ConfigVariable; + + /** + * Creates a plain object from a ConfigVariable message. Also converts values to other types if specified. + * @param message ConfigVariable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ConfigVariable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfigVariable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfigVariable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoleGrant. */ + interface IRoleGrant { + + /** RoleGrant principal */ + principal?: (google.cloud.connectors.v1.RoleGrant.Principal|keyof typeof google.cloud.connectors.v1.RoleGrant.Principal|null); + + /** RoleGrant roles */ + roles?: (string[]|null); + + /** RoleGrant resource */ + resource?: (google.cloud.connectors.v1.RoleGrant.IResource|null); + + /** RoleGrant helperTextTemplate */ + helperTextTemplate?: (string|null); + } + + /** Represents a RoleGrant. */ + class RoleGrant implements IRoleGrant { + + /** + * Constructs a new RoleGrant. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IRoleGrant); + + /** RoleGrant principal. */ + public principal: (google.cloud.connectors.v1.RoleGrant.Principal|keyof typeof google.cloud.connectors.v1.RoleGrant.Principal); + + /** RoleGrant roles. */ + public roles: string[]; + + /** RoleGrant resource. */ + public resource?: (google.cloud.connectors.v1.RoleGrant.IResource|null); + + /** RoleGrant helperTextTemplate. */ + public helperTextTemplate: string; + + /** + * Creates a new RoleGrant instance using the specified properties. + * @param [properties] Properties to set + * @returns RoleGrant instance + */ + public static create(properties?: google.cloud.connectors.v1.IRoleGrant): google.cloud.connectors.v1.RoleGrant; + + /** + * Encodes the specified RoleGrant message. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.verify|verify} messages. + * @param message RoleGrant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IRoleGrant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoleGrant message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.verify|verify} messages. + * @param message RoleGrant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IRoleGrant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoleGrant message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoleGrant + * @throws {Error} If the payload is not 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.connectors.v1.RoleGrant; + + /** + * Decodes a RoleGrant message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoleGrant + * @throws {Error} If the payload 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.connectors.v1.RoleGrant; + + /** + * Verifies a RoleGrant message. + * @param message Plain 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 RoleGrant message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoleGrant + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RoleGrant; + + /** + * Creates a plain object from a RoleGrant message. Also converts values to other types if specified. + * @param message RoleGrant + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RoleGrant, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoleGrant to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoleGrant + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RoleGrant { + + /** Principal enum. */ + enum Principal { + PRINCIPAL_UNSPECIFIED = 0, + CONNECTOR_SA = 1 + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource type */ + type?: (google.cloud.connectors.v1.RoleGrant.Resource.Type|keyof typeof google.cloud.connectors.v1.RoleGrant.Resource.Type|null); + + /** Resource pathTemplate */ + pathTemplate?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.RoleGrant.IResource); + + /** Resource type. */ + public type: (google.cloud.connectors.v1.RoleGrant.Resource.Type|keyof typeof google.cloud.connectors.v1.RoleGrant.Resource.Type); + + /** Resource pathTemplate. */ + public pathTemplate: string; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.connectors.v1.RoleGrant.IResource): google.cloud.connectors.v1.RoleGrant.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.RoleGrant.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.RoleGrant.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @throws {Error} If the payload is not 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.connectors.v1.RoleGrant.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @throws {Error} If the payload 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.connectors.v1.RoleGrant.Resource; + + /** + * Verifies a Resource message. + * @param message Plain 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RoleGrant.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RoleGrant.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Resource { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + GCP_PROJECT = 1, + GCP_RESOURCE = 2, + GCP_SECRETMANAGER_SECRET = 3, + GCP_SECRETMANAGER_SECRET_VERSION = 4 + } + } + } + + /** Properties of an AuthorizationCodeLink. */ + interface IAuthorizationCodeLink { + + /** AuthorizationCodeLink uri */ + uri?: (string|null); + + /** AuthorizationCodeLink scopes */ + scopes?: (string[]|null); + + /** AuthorizationCodeLink clientId */ + clientId?: (string|null); + + /** AuthorizationCodeLink enablePkce */ + enablePkce?: (boolean|null); + } + + /** Represents an AuthorizationCodeLink. */ + class AuthorizationCodeLink implements IAuthorizationCodeLink { + + /** + * Constructs a new AuthorizationCodeLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IAuthorizationCodeLink); + + /** AuthorizationCodeLink uri. */ + public uri: string; + + /** AuthorizationCodeLink scopes. */ + public scopes: string[]; + + /** AuthorizationCodeLink clientId. */ + public clientId: string; + + /** AuthorizationCodeLink enablePkce. */ + public enablePkce: boolean; + + /** + * Creates a new AuthorizationCodeLink instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizationCodeLink instance + */ + public static create(properties?: google.cloud.connectors.v1.IAuthorizationCodeLink): google.cloud.connectors.v1.AuthorizationCodeLink; + + /** + * Encodes the specified AuthorizationCodeLink message. Does not implicitly {@link google.cloud.connectors.v1.AuthorizationCodeLink.verify|verify} messages. + * @param message AuthorizationCodeLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IAuthorizationCodeLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizationCodeLink message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthorizationCodeLink.verify|verify} messages. + * @param message AuthorizationCodeLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IAuthorizationCodeLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizationCodeLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizationCodeLink + * @throws {Error} If the payload is not 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.connectors.v1.AuthorizationCodeLink; + + /** + * Decodes an AuthorizationCodeLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizationCodeLink + * @throws {Error} If the payload 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.connectors.v1.AuthorizationCodeLink; + + /** + * Verifies an AuthorizationCodeLink message. + * @param message Plain 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 AuthorizationCodeLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizationCodeLink + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthorizationCodeLink; + + /** + * Creates a plain object from an AuthorizationCodeLink message. Also converts values to other types if specified. + * @param message AuthorizationCodeLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthorizationCodeLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizationCodeLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizationCodeLink + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + PREVIEW = 1, + GA = 2, + DEPRECATED = 3, + PRIVATE_PREVIEW = 5 + } + + /** Properties of a Connection. */ + interface IConnection { + + /** Connection name */ + name?: (string|null); + + /** Connection createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Connection updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Connection labels */ + labels?: ({ [k: string]: string }|null); + + /** Connection description */ + description?: (string|null); + + /** Connection connectorVersion */ + connectorVersion?: (string|null); + + /** Connection status */ + status?: (google.cloud.connectors.v1.IConnectionStatus|null); + + /** Connection configVariables */ + configVariables?: (google.cloud.connectors.v1.IConfigVariable[]|null); + + /** Connection authConfig */ + authConfig?: (google.cloud.connectors.v1.IAuthConfig|null); + + /** Connection lockConfig */ + lockConfig?: (google.cloud.connectors.v1.ILockConfig|null); + + /** Connection destinationConfigs */ + destinationConfigs?: (google.cloud.connectors.v1.IDestinationConfig[]|null); + + /** Connection imageLocation */ + imageLocation?: (string|null); + + /** Connection serviceAccount */ + serviceAccount?: (string|null); + + /** Connection serviceDirectory */ + serviceDirectory?: (string|null); + + /** Connection envoyImageLocation */ + envoyImageLocation?: (string|null); + + /** Connection suspended */ + suspended?: (boolean|null); + + /** Connection nodeConfig */ + nodeConfig?: (google.cloud.connectors.v1.INodeConfig|null); + + /** Connection sslConfig */ + sslConfig?: (google.cloud.connectors.v1.ISslConfig|null); + } + + /** Represents a Connection. */ + class Connection implements IConnection { + + /** + * Constructs a new Connection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConnection); + + /** Connection name. */ + public name: string; + + /** Connection createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Connection updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Connection labels. */ + public labels: { [k: string]: string }; + + /** Connection description. */ + public description: string; + + /** Connection connectorVersion. */ + public connectorVersion: string; + + /** Connection status. */ + public status?: (google.cloud.connectors.v1.IConnectionStatus|null); + + /** Connection configVariables. */ + public configVariables: google.cloud.connectors.v1.IConfigVariable[]; + + /** Connection authConfig. */ + public authConfig?: (google.cloud.connectors.v1.IAuthConfig|null); + + /** Connection lockConfig. */ + public lockConfig?: (google.cloud.connectors.v1.ILockConfig|null); + + /** Connection destinationConfigs. */ + public destinationConfigs: google.cloud.connectors.v1.IDestinationConfig[]; + + /** Connection imageLocation. */ + public imageLocation: string; + + /** Connection serviceAccount. */ + public serviceAccount: string; + + /** Connection serviceDirectory. */ + public serviceDirectory: string; + + /** Connection envoyImageLocation. */ + public envoyImageLocation: string; + + /** Connection suspended. */ + public suspended: boolean; + + /** Connection nodeConfig. */ + public nodeConfig?: (google.cloud.connectors.v1.INodeConfig|null); + + /** Connection sslConfig. */ + public sslConfig?: (google.cloud.connectors.v1.ISslConfig|null); + + /** + * Creates a new Connection instance using the specified properties. + * @param [properties] Properties to set + * @returns Connection instance + */ + public static create(properties?: google.cloud.connectors.v1.IConnection): google.cloud.connectors.v1.Connection; + + /** + * Encodes the specified Connection message. Does not implicitly {@link google.cloud.connectors.v1.Connection.verify|verify} messages. + * @param message Connection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Connection message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Connection.verify|verify} messages. + * @param message Connection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Connection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Connection + * @throws {Error} If the payload is not 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.connectors.v1.Connection; + + /** + * Decodes a Connection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Connection + * @throws {Error} If the payload 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.connectors.v1.Connection; + + /** + * Verifies a Connection message. + * @param message Plain 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 Connection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Connection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Connection; + + /** + * Creates a plain object from a Connection message. Also converts values to other types if specified. + * @param message Connection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Connection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Connection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Connection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeConfig. */ + interface INodeConfig { + + /** NodeConfig minNodeCount */ + minNodeCount?: (number|null); + + /** NodeConfig maxNodeCount */ + maxNodeCount?: (number|null); + } + + /** Represents a NodeConfig. */ + class NodeConfig implements INodeConfig { + + /** + * Constructs a new NodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.INodeConfig); + + /** NodeConfig minNodeCount. */ + public minNodeCount: number; + + /** NodeConfig maxNodeCount. */ + public maxNodeCount: number; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.INodeConfig): google.cloud.connectors.v1.NodeConfig; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.connectors.v1.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.connectors.v1.NodeConfig; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.connectors.v1.NodeConfig; + + /** + * Verifies a NodeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.NodeConfig; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @param message NodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectionSchemaMetadata. */ + interface IConnectionSchemaMetadata { + + /** ConnectionSchemaMetadata entities */ + entities?: (string[]|null); + + /** ConnectionSchemaMetadata actions */ + actions?: (string[]|null); + + /** ConnectionSchemaMetadata name */ + name?: (string|null); + + /** ConnectionSchemaMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionSchemaMetadata refreshTime */ + refreshTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionSchemaMetadata state */ + state?: (google.cloud.connectors.v1.ConnectionSchemaMetadata.State|keyof typeof google.cloud.connectors.v1.ConnectionSchemaMetadata.State|null); + } + + /** Represents a ConnectionSchemaMetadata. */ + class ConnectionSchemaMetadata implements IConnectionSchemaMetadata { + + /** + * Constructs a new ConnectionSchemaMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConnectionSchemaMetadata); + + /** ConnectionSchemaMetadata entities. */ + public entities: string[]; + + /** ConnectionSchemaMetadata actions. */ + public actions: string[]; + + /** ConnectionSchemaMetadata name. */ + public name: string; + + /** ConnectionSchemaMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionSchemaMetadata refreshTime. */ + public refreshTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionSchemaMetadata state. */ + public state: (google.cloud.connectors.v1.ConnectionSchemaMetadata.State|keyof typeof google.cloud.connectors.v1.ConnectionSchemaMetadata.State); + + /** + * Creates a new ConnectionSchemaMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionSchemaMetadata instance + */ + public static create(properties?: google.cloud.connectors.v1.IConnectionSchemaMetadata): google.cloud.connectors.v1.ConnectionSchemaMetadata; + + /** + * Encodes the specified ConnectionSchemaMetadata message. Does not implicitly {@link google.cloud.connectors.v1.ConnectionSchemaMetadata.verify|verify} messages. + * @param message ConnectionSchemaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConnectionSchemaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionSchemaMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectionSchemaMetadata.verify|verify} messages. + * @param message ConnectionSchemaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConnectionSchemaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionSchemaMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionSchemaMetadata + * @throws {Error} If the payload is not 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.connectors.v1.ConnectionSchemaMetadata; + + /** + * Decodes a ConnectionSchemaMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionSchemaMetadata + * @throws {Error} If the payload 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.connectors.v1.ConnectionSchemaMetadata; + + /** + * Verifies a ConnectionSchemaMetadata message. + * @param message Plain 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 ConnectionSchemaMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionSchemaMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ConnectionSchemaMetadata; + + /** + * Creates a plain object from a ConnectionSchemaMetadata message. Also converts values to other types if specified. + * @param message ConnectionSchemaMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ConnectionSchemaMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionSchemaMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionSchemaMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConnectionSchemaMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + REFRESHING = 1, + UPDATED = 2 + } + } + + /** Properties of a RuntimeEntitySchema. */ + interface IRuntimeEntitySchema { + + /** RuntimeEntitySchema entity */ + entity?: (string|null); + + /** RuntimeEntitySchema fields */ + fields?: (google.cloud.connectors.v1.RuntimeEntitySchema.IField[]|null); + } + + /** Represents a RuntimeEntitySchema. */ + class RuntimeEntitySchema implements IRuntimeEntitySchema { + + /** + * Constructs a new RuntimeEntitySchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IRuntimeEntitySchema); + + /** RuntimeEntitySchema entity. */ + public entity: string; + + /** RuntimeEntitySchema fields. */ + public fields: google.cloud.connectors.v1.RuntimeEntitySchema.IField[]; + + /** + * Creates a new RuntimeEntitySchema instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeEntitySchema instance + */ + public static create(properties?: google.cloud.connectors.v1.IRuntimeEntitySchema): google.cloud.connectors.v1.RuntimeEntitySchema; + + /** + * Encodes the specified RuntimeEntitySchema message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.verify|verify} messages. + * @param message RuntimeEntitySchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IRuntimeEntitySchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeEntitySchema message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.verify|verify} messages. + * @param message RuntimeEntitySchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IRuntimeEntitySchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeEntitySchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeEntitySchema + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeEntitySchema; + + /** + * Decodes a RuntimeEntitySchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeEntitySchema + * @throws {Error} If the payload 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.connectors.v1.RuntimeEntitySchema; + + /** + * Verifies a RuntimeEntitySchema message. + * @param message Plain 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 RuntimeEntitySchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeEntitySchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeEntitySchema; + + /** + * Creates a plain object from a RuntimeEntitySchema message. Also converts values to other types if specified. + * @param message RuntimeEntitySchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeEntitySchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeEntitySchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeEntitySchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RuntimeEntitySchema { + + /** Properties of a Field. */ + interface IField { + + /** Field field */ + field?: (string|null); + + /** Field description */ + description?: (string|null); + + /** Field dataType */ + dataType?: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType|null); + + /** Field key */ + key?: (boolean|null); + + /** Field readonly */ + readonly?: (boolean|null); + + /** Field nullable */ + nullable?: (boolean|null); + + /** Field defaultValue */ + defaultValue?: (google.protobuf.IValue|null); + + /** Field additionalDetails */ + additionalDetails?: (google.protobuf.IStruct|null); + } + + /** Represents a Field. */ + class Field implements IField { + + /** + * Constructs a new Field. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.RuntimeEntitySchema.IField); + + /** Field field. */ + public field: string; + + /** Field description. */ + public description: string; + + /** Field dataType. */ + public dataType: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType); + + /** Field key. */ + public key: boolean; + + /** Field readonly. */ + public readonly: boolean; + + /** Field nullable. */ + public nullable: boolean; + + /** Field defaultValue. */ + public defaultValue?: (google.protobuf.IValue|null); + + /** Field additionalDetails. */ + public additionalDetails?: (google.protobuf.IStruct|null); + + /** + * Creates a new Field instance using the specified properties. + * @param [properties] Properties to set + * @returns Field instance + */ + public static create(properties?: google.cloud.connectors.v1.RuntimeEntitySchema.IField): google.cloud.connectors.v1.RuntimeEntitySchema.Field; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.RuntimeEntitySchema.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.RuntimeEntitySchema.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Field message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Field + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeEntitySchema.Field; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Field + * @throws {Error} If the payload 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.connectors.v1.RuntimeEntitySchema.Field; + + /** + * Verifies a Field message. + * @param message Plain 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 Field message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Field + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeEntitySchema.Field; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @param message Field + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeEntitySchema.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Field to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Field + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RuntimeActionSchema. */ + interface IRuntimeActionSchema { + + /** RuntimeActionSchema action */ + action?: (string|null); + + /** RuntimeActionSchema inputParameters */ + inputParameters?: (google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter[]|null); + + /** RuntimeActionSchema resultMetadata */ + resultMetadata?: (google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata[]|null); + } + + /** Represents a RuntimeActionSchema. */ + class RuntimeActionSchema implements IRuntimeActionSchema { + + /** + * Constructs a new RuntimeActionSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IRuntimeActionSchema); + + /** RuntimeActionSchema action. */ + public action: string; + + /** RuntimeActionSchema inputParameters. */ + public inputParameters: google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter[]; + + /** RuntimeActionSchema resultMetadata. */ + public resultMetadata: google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata[]; + + /** + * Creates a new RuntimeActionSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeActionSchema instance + */ + public static create(properties?: google.cloud.connectors.v1.IRuntimeActionSchema): google.cloud.connectors.v1.RuntimeActionSchema; + + /** + * Encodes the specified RuntimeActionSchema message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.verify|verify} messages. + * @param message RuntimeActionSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IRuntimeActionSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeActionSchema message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.verify|verify} messages. + * @param message RuntimeActionSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IRuntimeActionSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeActionSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeActionSchema + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeActionSchema; + + /** + * Decodes a RuntimeActionSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeActionSchema + * @throws {Error} If the payload 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.connectors.v1.RuntimeActionSchema; + + /** + * Verifies a RuntimeActionSchema message. + * @param message Plain 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 RuntimeActionSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeActionSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeActionSchema; + + /** + * Creates a plain object from a RuntimeActionSchema message. Also converts values to other types if specified. + * @param message RuntimeActionSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeActionSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeActionSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeActionSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RuntimeActionSchema { + + /** Properties of an InputParameter. */ + interface IInputParameter { + + /** InputParameter parameter */ + parameter?: (string|null); + + /** InputParameter description */ + description?: (string|null); + + /** InputParameter dataType */ + dataType?: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType|null); + + /** InputParameter nullable */ + nullable?: (boolean|null); + + /** InputParameter defaultValue */ + defaultValue?: (google.protobuf.IValue|null); + } + + /** Represents an InputParameter. */ + class InputParameter implements IInputParameter { + + /** + * Constructs a new InputParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter); + + /** InputParameter parameter. */ + public parameter: string; + + /** InputParameter description. */ + public description: string; + + /** InputParameter dataType. */ + public dataType: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType); + + /** InputParameter nullable. */ + public nullable: boolean; + + /** InputParameter defaultValue. */ + public defaultValue?: (google.protobuf.IValue|null); + + /** + * Creates a new InputParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns InputParameter instance + */ + public static create(properties?: google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter): google.cloud.connectors.v1.RuntimeActionSchema.InputParameter; + + /** + * Encodes the specified InputParameter message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.verify|verify} messages. + * @param message InputParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputParameter message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.verify|verify} messages. + * @param message InputParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputParameter + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeActionSchema.InputParameter; + + /** + * Decodes an InputParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputParameter + * @throws {Error} If the payload 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.connectors.v1.RuntimeActionSchema.InputParameter; + + /** + * Verifies an InputParameter message. + * @param message Plain 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 InputParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputParameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeActionSchema.InputParameter; + + /** + * Creates a plain object from an InputParameter message. Also converts values to other types if specified. + * @param message InputParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeActionSchema.InputParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResultMetadata. */ + interface IResultMetadata { + + /** ResultMetadata field */ + field?: (string|null); + + /** ResultMetadata description */ + description?: (string|null); + + /** ResultMetadata dataType */ + dataType?: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType|null); + } + + /** Represents a ResultMetadata. */ + class ResultMetadata implements IResultMetadata { + + /** + * Constructs a new ResultMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata); + + /** ResultMetadata field. */ + public field: string; + + /** ResultMetadata description. */ + public description: string; + + /** ResultMetadata dataType. */ + public dataType: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType); + + /** + * Creates a new ResultMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultMetadata instance + */ + public static create(properties?: google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata): google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata; + + /** + * Encodes the specified ResultMetadata message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.verify|verify} messages. + * @param message ResultMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.verify|verify} messages. + * @param message ResultMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultMetadata + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeActionSchema.ResultMetadata; + + /** + * Decodes a ResultMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultMetadata + * @throws {Error} If the payload 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.connectors.v1.RuntimeActionSchema.ResultMetadata; + + /** + * Verifies a ResultMetadata message. + * @param message Plain 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 ResultMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata; + + /** + * Creates a plain object from a ResultMetadata message. Also converts values to other types if specified. + * @param message ResultMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a LockConfig. */ + interface ILockConfig { + + /** LockConfig locked */ + locked?: (boolean|null); + + /** LockConfig reason */ + reason?: (string|null); + } + + /** Represents a LockConfig. */ + class LockConfig implements ILockConfig { + + /** + * Constructs a new LockConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ILockConfig); + + /** LockConfig locked. */ + public locked: boolean; + + /** LockConfig reason. */ + public reason: string; + + /** + * Creates a new LockConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LockConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.ILockConfig): google.cloud.connectors.v1.LockConfig; + + /** + * Encodes the specified LockConfig message. Does not implicitly {@link google.cloud.connectors.v1.LockConfig.verify|verify} messages. + * @param message LockConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ILockConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LockConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.LockConfig.verify|verify} messages. + * @param message LockConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ILockConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LockConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LockConfig + * @throws {Error} If the payload is not 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.connectors.v1.LockConfig; + + /** + * Decodes a LockConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LockConfig + * @throws {Error} If the payload 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.connectors.v1.LockConfig; + + /** + * Verifies a LockConfig message. + * @param message Plain 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 LockConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LockConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.LockConfig; + + /** + * Creates a plain object from a LockConfig message. Also converts values to other types if specified. + * @param message LockConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.LockConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LockConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LockConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectionsRequest. */ + interface IListConnectionsRequest { + + /** ListConnectionsRequest parent */ + parent?: (string|null); + + /** ListConnectionsRequest pageSize */ + pageSize?: (number|null); + + /** ListConnectionsRequest pageToken */ + pageToken?: (string|null); + + /** ListConnectionsRequest filter */ + filter?: (string|null); + + /** ListConnectionsRequest orderBy */ + orderBy?: (string|null); + + /** ListConnectionsRequest view */ + view?: (google.cloud.connectors.v1.ConnectionView|keyof typeof google.cloud.connectors.v1.ConnectionView|null); + } + + /** Represents a ListConnectionsRequest. */ + class ListConnectionsRequest implements IListConnectionsRequest { + + /** + * Constructs a new ListConnectionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectionsRequest); + + /** ListConnectionsRequest parent. */ + public parent: string; + + /** ListConnectionsRequest pageSize. */ + public pageSize: number; + + /** ListConnectionsRequest pageToken. */ + public pageToken: string; + + /** ListConnectionsRequest filter. */ + public filter: string; + + /** ListConnectionsRequest orderBy. */ + public orderBy: string; + + /** ListConnectionsRequest view. */ + public view: (google.cloud.connectors.v1.ConnectionView|keyof typeof google.cloud.connectors.v1.ConnectionView); + + /** + * Creates a new ListConnectionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectionsRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectionsRequest): google.cloud.connectors.v1.ListConnectionsRequest; + + /** + * Encodes the specified ListConnectionsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsRequest.verify|verify} messages. + * @param message ListConnectionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectionsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsRequest.verify|verify} messages. + * @param message ListConnectionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectionsRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectionsRequest; + + /** + * Decodes a ListConnectionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectionsRequest + * @throws {Error} If the payload 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.connectors.v1.ListConnectionsRequest; + + /** + * Verifies a ListConnectionsRequest message. + * @param message Plain 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 ListConnectionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectionsRequest; + + /** + * Creates a plain object from a ListConnectionsRequest message. Also converts values to other types if specified. + * @param message ListConnectionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectionsResponse. */ + interface IListConnectionsResponse { + + /** ListConnectionsResponse connections */ + connections?: (google.cloud.connectors.v1.IConnection[]|null); + + /** ListConnectionsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListConnectionsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListConnectionsResponse. */ + class ListConnectionsResponse implements IListConnectionsResponse { + + /** + * Constructs a new ListConnectionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectionsResponse); + + /** ListConnectionsResponse connections. */ + public connections: google.cloud.connectors.v1.IConnection[]; + + /** ListConnectionsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListConnectionsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListConnectionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectionsResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectionsResponse): google.cloud.connectors.v1.ListConnectionsResponse; + + /** + * Encodes the specified ListConnectionsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsResponse.verify|verify} messages. + * @param message ListConnectionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectionsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsResponse.verify|verify} messages. + * @param message ListConnectionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectionsResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectionsResponse; + + /** + * Decodes a ListConnectionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectionsResponse + * @throws {Error} If the payload 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.connectors.v1.ListConnectionsResponse; + + /** + * Verifies a ListConnectionsResponse message. + * @param message Plain 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 ListConnectionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectionsResponse; + + /** + * Creates a plain object from a ListConnectionsResponse message. Also converts values to other types if specified. + * @param message ListConnectionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectionRequest. */ + interface IGetConnectionRequest { + + /** GetConnectionRequest name */ + name?: (string|null); + + /** GetConnectionRequest view */ + view?: (google.cloud.connectors.v1.ConnectionView|keyof typeof google.cloud.connectors.v1.ConnectionView|null); + } + + /** Represents a GetConnectionRequest. */ + class GetConnectionRequest implements IGetConnectionRequest { + + /** + * Constructs a new GetConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetConnectionRequest); + + /** GetConnectionRequest name. */ + public name: string; + + /** GetConnectionRequest view. */ + public view: (google.cloud.connectors.v1.ConnectionView|keyof typeof google.cloud.connectors.v1.ConnectionView); + + /** + * Creates a new GetConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectionRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetConnectionRequest): google.cloud.connectors.v1.GetConnectionRequest; + + /** + * Encodes the specified GetConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionRequest.verify|verify} messages. + * @param message GetConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionRequest.verify|verify} messages. + * @param message GetConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectionRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetConnectionRequest; + + /** + * Decodes a GetConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectionRequest + * @throws {Error} If the payload 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.connectors.v1.GetConnectionRequest; + + /** + * Verifies a GetConnectionRequest message. + * @param message Plain 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 GetConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetConnectionRequest; + + /** + * Creates a plain object from a GetConnectionRequest message. Also converts values to other types if specified. + * @param message GetConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateConnectionRequest. */ + interface ICreateConnectionRequest { + + /** CreateConnectionRequest parent */ + parent?: (string|null); + + /** CreateConnectionRequest connectionId */ + connectionId?: (string|null); + + /** CreateConnectionRequest connection */ + connection?: (google.cloud.connectors.v1.IConnection|null); + } + + /** Represents a CreateConnectionRequest. */ + class CreateConnectionRequest implements ICreateConnectionRequest { + + /** + * Constructs a new CreateConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ICreateConnectionRequest); + + /** CreateConnectionRequest parent. */ + public parent: string; + + /** CreateConnectionRequest connectionId. */ + public connectionId: string; + + /** CreateConnectionRequest connection. */ + public connection?: (google.cloud.connectors.v1.IConnection|null); + + /** + * Creates a new CreateConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateConnectionRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.ICreateConnectionRequest): google.cloud.connectors.v1.CreateConnectionRequest; + + /** + * Encodes the specified CreateConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.CreateConnectionRequest.verify|verify} messages. + * @param message CreateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ICreateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.CreateConnectionRequest.verify|verify} messages. + * @param message CreateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ICreateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateConnectionRequest + * @throws {Error} If the payload is not 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.connectors.v1.CreateConnectionRequest; + + /** + * Decodes a CreateConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateConnectionRequest + * @throws {Error} If the payload 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.connectors.v1.CreateConnectionRequest; + + /** + * Verifies a CreateConnectionRequest message. + * @param message Plain 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 CreateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.CreateConnectionRequest; + + /** + * Creates a plain object from a CreateConnectionRequest message. Also converts values to other types if specified. + * @param message CreateConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.CreateConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateConnectionRequest. */ + interface IUpdateConnectionRequest { + + /** UpdateConnectionRequest connection */ + connection?: (google.cloud.connectors.v1.IConnection|null); + + /** UpdateConnectionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateConnectionRequest. */ + class UpdateConnectionRequest implements IUpdateConnectionRequest { + + /** + * Constructs a new UpdateConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IUpdateConnectionRequest); + + /** UpdateConnectionRequest connection. */ + public connection?: (google.cloud.connectors.v1.IConnection|null); + + /** UpdateConnectionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateConnectionRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IUpdateConnectionRequest): google.cloud.connectors.v1.UpdateConnectionRequest; + + /** + * Encodes the specified UpdateConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.UpdateConnectionRequest.verify|verify} messages. + * @param message UpdateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IUpdateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.UpdateConnectionRequest.verify|verify} messages. + * @param message UpdateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IUpdateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateConnectionRequest + * @throws {Error} If the payload is not 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.connectors.v1.UpdateConnectionRequest; + + /** + * Decodes an UpdateConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateConnectionRequest + * @throws {Error} If the payload 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.connectors.v1.UpdateConnectionRequest; + + /** + * Verifies an UpdateConnectionRequest message. + * @param message Plain 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 UpdateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.UpdateConnectionRequest; + + /** + * Creates a plain object from an UpdateConnectionRequest message. Also converts values to other types if specified. + * @param message UpdateConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.UpdateConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteConnectionRequest. */ + interface IDeleteConnectionRequest { + + /** DeleteConnectionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteConnectionRequest. */ + class DeleteConnectionRequest implements IDeleteConnectionRequest { + + /** + * Constructs a new DeleteConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IDeleteConnectionRequest); + + /** DeleteConnectionRequest name. */ + public name: string; + + /** + * Creates a new DeleteConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteConnectionRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IDeleteConnectionRequest): google.cloud.connectors.v1.DeleteConnectionRequest; + + /** + * Encodes the specified DeleteConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.DeleteConnectionRequest.verify|verify} messages. + * @param message DeleteConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IDeleteConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.DeleteConnectionRequest.verify|verify} messages. + * @param message DeleteConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IDeleteConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteConnectionRequest + * @throws {Error} If the payload is not 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.connectors.v1.DeleteConnectionRequest; + + /** + * Decodes a DeleteConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteConnectionRequest + * @throws {Error} If the payload 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.connectors.v1.DeleteConnectionRequest; + + /** + * Verifies a DeleteConnectionRequest message. + * @param message Plain 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 DeleteConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.DeleteConnectionRequest; + + /** + * Creates a plain object from a DeleteConnectionRequest message. Also converts values to other types if specified. + * @param message DeleteConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.DeleteConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectionSchemaMetadataRequest. */ + interface IGetConnectionSchemaMetadataRequest { + + /** GetConnectionSchemaMetadataRequest name */ + name?: (string|null); + } + + /** Represents a GetConnectionSchemaMetadataRequest. */ + class GetConnectionSchemaMetadataRequest implements IGetConnectionSchemaMetadataRequest { + + /** + * Constructs a new GetConnectionSchemaMetadataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest); + + /** GetConnectionSchemaMetadataRequest name. */ + public name: string; + + /** + * Creates a new GetConnectionSchemaMetadataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectionSchemaMetadataRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest): google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest; + + /** + * Encodes the specified GetConnectionSchemaMetadataRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest.verify|verify} messages. + * @param message GetConnectionSchemaMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectionSchemaMetadataRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest.verify|verify} messages. + * @param message GetConnectionSchemaMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectionSchemaMetadataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetConnectionSchemaMetadataRequest; + + /** + * Decodes a GetConnectionSchemaMetadataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectionSchemaMetadataRequest + * @throws {Error} If the payload 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.connectors.v1.GetConnectionSchemaMetadataRequest; + + /** + * Verifies a GetConnectionSchemaMetadataRequest message. + * @param message Plain 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 GetConnectionSchemaMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectionSchemaMetadataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest; + + /** + * Creates a plain object from a GetConnectionSchemaMetadataRequest message. Also converts values to other types if specified. + * @param message GetConnectionSchemaMetadataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectionSchemaMetadataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectionSchemaMetadataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RefreshConnectionSchemaMetadataRequest. */ + interface IRefreshConnectionSchemaMetadataRequest { + + /** RefreshConnectionSchemaMetadataRequest name */ + name?: (string|null); + } + + /** Represents a RefreshConnectionSchemaMetadataRequest. */ + class RefreshConnectionSchemaMetadataRequest implements IRefreshConnectionSchemaMetadataRequest { + + /** + * Constructs a new RefreshConnectionSchemaMetadataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest); + + /** RefreshConnectionSchemaMetadataRequest name. */ + public name: string; + + /** + * Creates a new RefreshConnectionSchemaMetadataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RefreshConnectionSchemaMetadataRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest): google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest; + + /** + * Encodes the specified RefreshConnectionSchemaMetadataRequest message. Does not implicitly {@link google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest.verify|verify} messages. + * @param message RefreshConnectionSchemaMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RefreshConnectionSchemaMetadataRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest.verify|verify} messages. + * @param message RefreshConnectionSchemaMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RefreshConnectionSchemaMetadataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RefreshConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not 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.connectors.v1.RefreshConnectionSchemaMetadataRequest; + + /** + * Decodes a RefreshConnectionSchemaMetadataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RefreshConnectionSchemaMetadataRequest + * @throws {Error} If the payload 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.connectors.v1.RefreshConnectionSchemaMetadataRequest; + + /** + * Verifies a RefreshConnectionSchemaMetadataRequest message. + * @param message Plain 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 RefreshConnectionSchemaMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RefreshConnectionSchemaMetadataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest; + + /** + * Creates a plain object from a RefreshConnectionSchemaMetadataRequest message. Also converts values to other types if specified. + * @param message RefreshConnectionSchemaMetadataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RefreshConnectionSchemaMetadataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RefreshConnectionSchemaMetadataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeEntitySchemasRequest. */ + interface IListRuntimeEntitySchemasRequest { + + /** ListRuntimeEntitySchemasRequest parent */ + parent?: (string|null); + + /** ListRuntimeEntitySchemasRequest pageSize */ + pageSize?: (number|null); + + /** ListRuntimeEntitySchemasRequest pageToken */ + pageToken?: (string|null); + + /** ListRuntimeEntitySchemasRequest filter */ + filter?: (string|null); + } + + /** Represents a ListRuntimeEntitySchemasRequest. */ + class ListRuntimeEntitySchemasRequest implements IListRuntimeEntitySchemasRequest { + + /** + * Constructs a new ListRuntimeEntitySchemasRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest); + + /** ListRuntimeEntitySchemasRequest parent. */ + public parent: string; + + /** ListRuntimeEntitySchemasRequest pageSize. */ + public pageSize: number; + + /** ListRuntimeEntitySchemasRequest pageToken. */ + public pageToken: string; + + /** ListRuntimeEntitySchemasRequest filter. */ + public filter: string; + + /** + * Creates a new ListRuntimeEntitySchemasRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeEntitySchemasRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest): google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest; + + /** + * Encodes the specified ListRuntimeEntitySchemasRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest.verify|verify} messages. + * @param message ListRuntimeEntitySchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeEntitySchemasRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest.verify|verify} messages. + * @param message ListRuntimeEntitySchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeEntitySchemasRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeEntitySchemasRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListRuntimeEntitySchemasRequest; + + /** + * Decodes a ListRuntimeEntitySchemasRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeEntitySchemasRequest + * @throws {Error} If the payload 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.connectors.v1.ListRuntimeEntitySchemasRequest; + + /** + * Verifies a ListRuntimeEntitySchemasRequest message. + * @param message Plain 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 ListRuntimeEntitySchemasRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeEntitySchemasRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest; + + /** + * Creates a plain object from a ListRuntimeEntitySchemasRequest message. Also converts values to other types if specified. + * @param message ListRuntimeEntitySchemasRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeEntitySchemasRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeEntitySchemasRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeEntitySchemasResponse. */ + interface IListRuntimeEntitySchemasResponse { + + /** ListRuntimeEntitySchemasResponse runtimeEntitySchemas */ + runtimeEntitySchemas?: (google.cloud.connectors.v1.IRuntimeEntitySchema[]|null); + + /** ListRuntimeEntitySchemasResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRuntimeEntitySchemasResponse. */ + class ListRuntimeEntitySchemasResponse implements IListRuntimeEntitySchemasResponse { + + /** + * Constructs a new ListRuntimeEntitySchemasResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse); + + /** ListRuntimeEntitySchemasResponse runtimeEntitySchemas. */ + public runtimeEntitySchemas: google.cloud.connectors.v1.IRuntimeEntitySchema[]; + + /** ListRuntimeEntitySchemasResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRuntimeEntitySchemasResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeEntitySchemasResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse): google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse; + + /** + * Encodes the specified ListRuntimeEntitySchemasResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.verify|verify} messages. + * @param message ListRuntimeEntitySchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeEntitySchemasResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.verify|verify} messages. + * @param message ListRuntimeEntitySchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeEntitySchemasResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeEntitySchemasResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListRuntimeEntitySchemasResponse; + + /** + * Decodes a ListRuntimeEntitySchemasResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeEntitySchemasResponse + * @throws {Error} If the payload 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.connectors.v1.ListRuntimeEntitySchemasResponse; + + /** + * Verifies a ListRuntimeEntitySchemasResponse message. + * @param message Plain 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 ListRuntimeEntitySchemasResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeEntitySchemasResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse; + + /** + * Creates a plain object from a ListRuntimeEntitySchemasResponse message. Also converts values to other types if specified. + * @param message ListRuntimeEntitySchemasResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeEntitySchemasResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeEntitySchemasResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeActionSchemasRequest. */ + interface IListRuntimeActionSchemasRequest { + + /** ListRuntimeActionSchemasRequest parent */ + parent?: (string|null); + + /** ListRuntimeActionSchemasRequest pageSize */ + pageSize?: (number|null); + + /** ListRuntimeActionSchemasRequest pageToken */ + pageToken?: (string|null); + + /** ListRuntimeActionSchemasRequest filter */ + filter?: (string|null); + } + + /** Represents a ListRuntimeActionSchemasRequest. */ + class ListRuntimeActionSchemasRequest implements IListRuntimeActionSchemasRequest { + + /** + * Constructs a new ListRuntimeActionSchemasRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest); + + /** ListRuntimeActionSchemasRequest parent. */ + public parent: string; + + /** ListRuntimeActionSchemasRequest pageSize. */ + public pageSize: number; + + /** ListRuntimeActionSchemasRequest pageToken. */ + public pageToken: string; + + /** ListRuntimeActionSchemasRequest filter. */ + public filter: string; + + /** + * Creates a new ListRuntimeActionSchemasRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeActionSchemasRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest): google.cloud.connectors.v1.ListRuntimeActionSchemasRequest; + + /** + * Encodes the specified ListRuntimeActionSchemasRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasRequest.verify|verify} messages. + * @param message ListRuntimeActionSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeActionSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasRequest.verify|verify} messages. + * @param message ListRuntimeActionSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeActionSchemasRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeActionSchemasRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListRuntimeActionSchemasRequest; + + /** + * Decodes a ListRuntimeActionSchemasRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeActionSchemasRequest + * @throws {Error} If the payload 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.connectors.v1.ListRuntimeActionSchemasRequest; + + /** + * Verifies a ListRuntimeActionSchemasRequest message. + * @param message Plain 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 ListRuntimeActionSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeActionSchemasRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListRuntimeActionSchemasRequest; + + /** + * Creates a plain object from a ListRuntimeActionSchemasRequest message. Also converts values to other types if specified. + * @param message ListRuntimeActionSchemasRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListRuntimeActionSchemasRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeActionSchemasRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeActionSchemasRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeActionSchemasResponse. */ + interface IListRuntimeActionSchemasResponse { + + /** ListRuntimeActionSchemasResponse runtimeActionSchemas */ + runtimeActionSchemas?: (google.cloud.connectors.v1.IRuntimeActionSchema[]|null); + + /** ListRuntimeActionSchemasResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRuntimeActionSchemasResponse. */ + class ListRuntimeActionSchemasResponse implements IListRuntimeActionSchemasResponse { + + /** + * Constructs a new ListRuntimeActionSchemasResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListRuntimeActionSchemasResponse); + + /** ListRuntimeActionSchemasResponse runtimeActionSchemas. */ + public runtimeActionSchemas: google.cloud.connectors.v1.IRuntimeActionSchema[]; + + /** ListRuntimeActionSchemasResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRuntimeActionSchemasResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeActionSchemasResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListRuntimeActionSchemasResponse): google.cloud.connectors.v1.ListRuntimeActionSchemasResponse; + + /** + * Encodes the specified ListRuntimeActionSchemasResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.verify|verify} messages. + * @param message ListRuntimeActionSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListRuntimeActionSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeActionSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.verify|verify} messages. + * @param message ListRuntimeActionSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListRuntimeActionSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeActionSchemasResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeActionSchemasResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListRuntimeActionSchemasResponse; + + /** + * Decodes a ListRuntimeActionSchemasResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeActionSchemasResponse + * @throws {Error} If the payload 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.connectors.v1.ListRuntimeActionSchemasResponse; + + /** + * Verifies a ListRuntimeActionSchemasResponse message. + * @param message Plain 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 ListRuntimeActionSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeActionSchemasResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListRuntimeActionSchemasResponse; + + /** + * Creates a plain object from a ListRuntimeActionSchemasResponse message. Also converts values to other types if specified. + * @param message ListRuntimeActionSchemasResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListRuntimeActionSchemasResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeActionSchemasResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeActionSchemasResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectionStatus. */ + interface IConnectionStatus { + + /** ConnectionStatus state */ + state?: (google.cloud.connectors.v1.ConnectionStatus.State|keyof typeof google.cloud.connectors.v1.ConnectionStatus.State|null); + + /** ConnectionStatus description */ + description?: (string|null); + + /** ConnectionStatus status */ + status?: (string|null); + } + + /** Represents a ConnectionStatus. */ + class ConnectionStatus implements IConnectionStatus { + + /** + * Constructs a new ConnectionStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConnectionStatus); + + /** ConnectionStatus state. */ + public state: (google.cloud.connectors.v1.ConnectionStatus.State|keyof typeof google.cloud.connectors.v1.ConnectionStatus.State); + + /** ConnectionStatus description. */ + public description: string; + + /** ConnectionStatus status. */ + public status: string; + + /** + * Creates a new ConnectionStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionStatus instance + */ + public static create(properties?: google.cloud.connectors.v1.IConnectionStatus): google.cloud.connectors.v1.ConnectionStatus; + + /** + * Encodes the specified ConnectionStatus message. Does not implicitly {@link google.cloud.connectors.v1.ConnectionStatus.verify|verify} messages. + * @param message ConnectionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConnectionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionStatus message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectionStatus.verify|verify} messages. + * @param message ConnectionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConnectionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionStatus + * @throws {Error} If the payload is not 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.connectors.v1.ConnectionStatus; + + /** + * Decodes a ConnectionStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionStatus + * @throws {Error} If the payload 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.connectors.v1.ConnectionStatus; + + /** + * Verifies a ConnectionStatus message. + * @param message Plain 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 ConnectionStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ConnectionStatus; + + /** + * Creates a plain object from a ConnectionStatus message. Also converts values to other types if specified. + * @param message ConnectionStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ConnectionStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConnectionStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + INACTIVE = 3, + DELETING = 4, + UPDATING = 5, + ERROR = 6, + AUTHORIZATION_REQUIRED = 7 + } + } + + /** DataType enum. */ + enum DataType { + DATA_TYPE_UNSPECIFIED = 0, + DATA_TYPE_INT = 1, + DATA_TYPE_SMALLINT = 2, + DATA_TYPE_DOUBLE = 3, + DATA_TYPE_DATE = 4, + DATA_TYPE_DATETIME = 5, + DATA_TYPE_TIME = 6, + DATA_TYPE_STRING = 7, + DATA_TYPE_LONG = 8, + DATA_TYPE_BOOLEAN = 9, + DATA_TYPE_DECIMAL = 10, + DATA_TYPE_UUID = 11, + DATA_TYPE_BLOB = 12, + DATA_TYPE_BIT = 13, + DATA_TYPE_TINYINT = 14, + DATA_TYPE_INTEGER = 15, + DATA_TYPE_BIGINT = 16, + DATA_TYPE_FLOAT = 17, + DATA_TYPE_REAL = 18, + DATA_TYPE_NUMERIC = 19, + DATA_TYPE_CHAR = 20, + DATA_TYPE_VARCHAR = 21, + DATA_TYPE_LONGVARCHAR = 22, + DATA_TYPE_TIMESTAMP = 23, + DATA_TYPE_NCHAR = 24, + DATA_TYPE_NVARCHAR = 25, + DATA_TYPE_LONGNVARCHAR = 26, + DATA_TYPE_NULL = 27, + DATA_TYPE_OTHER = 28, + DATA_TYPE_JAVA_OBJECT = 29, + DATA_TYPE_DISTINCT = 30, + DATA_TYPE_STRUCT = 31, + DATA_TYPE_ARRAY = 32, + DATA_TYPE_CLOB = 33, + DATA_TYPE_REF = 34, + DATA_TYPE_DATALINK = 35, + DATA_TYPE_ROWID = 36, + DATA_TYPE_BINARY = 37, + DATA_TYPE_VARBINARY = 38, + DATA_TYPE_LONGVARBINARY = 39, + DATA_TYPE_NCLOB = 40, + DATA_TYPE_SQLXML = 41, + DATA_TYPE_REF_CURSOR = 42, + DATA_TYPE_TIME_WITH_TIMEZONE = 43, + DATA_TYPE_TIMESTAMP_WITH_TIMEZONE = 44 + } + + /** ConnectionView enum. */ + enum ConnectionView { + CONNECTION_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + + /** Properties of a DestinationConfig. */ + interface IDestinationConfig { + + /** DestinationConfig key */ + key?: (string|null); + + /** DestinationConfig destinations */ + destinations?: (google.cloud.connectors.v1.IDestination[]|null); + } + + /** Represents a DestinationConfig. */ + class DestinationConfig implements IDestinationConfig { + + /** + * Constructs a new DestinationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IDestinationConfig); + + /** DestinationConfig key. */ + public key: string; + + /** DestinationConfig destinations. */ + public destinations: google.cloud.connectors.v1.IDestination[]; + + /** + * Creates a new DestinationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DestinationConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.IDestinationConfig): google.cloud.connectors.v1.DestinationConfig; + + /** + * Encodes the specified DestinationConfig message. Does not implicitly {@link google.cloud.connectors.v1.DestinationConfig.verify|verify} messages. + * @param message DestinationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IDestinationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DestinationConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.DestinationConfig.verify|verify} messages. + * @param message DestinationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IDestinationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DestinationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DestinationConfig + * @throws {Error} If the payload is not 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.connectors.v1.DestinationConfig; + + /** + * Decodes a DestinationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DestinationConfig + * @throws {Error} If the payload 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.connectors.v1.DestinationConfig; + + /** + * Verifies a DestinationConfig message. + * @param message Plain 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 DestinationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DestinationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.DestinationConfig; + + /** + * Creates a plain object from a DestinationConfig message. Also converts values to other types if specified. + * @param message DestinationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.DestinationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DestinationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DestinationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Destination. */ + interface IDestination { + + /** Destination serviceAttachment */ + serviceAttachment?: (string|null); + + /** Destination host */ + host?: (string|null); + + /** Destination port */ + port?: (number|null); + } + + /** Represents a Destination. */ + class Destination implements IDestination { + + /** + * Constructs a new Destination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IDestination); + + /** Destination serviceAttachment. */ + public serviceAttachment?: (string|null); + + /** Destination host. */ + public host?: (string|null); + + /** Destination port. */ + public port: number; + + /** Destination destination. */ + public destination?: ("serviceAttachment"|"host"); + + /** + * Creates a new Destination instance using the specified properties. + * @param [properties] Properties to set + * @returns Destination instance + */ + public static create(properties?: google.cloud.connectors.v1.IDestination): google.cloud.connectors.v1.Destination; + + /** + * Encodes the specified Destination message. Does not implicitly {@link google.cloud.connectors.v1.Destination.verify|verify} messages. + * @param message Destination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Destination.verify|verify} messages. + * @param message Destination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Destination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Destination + * @throws {Error} If the payload is not 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.connectors.v1.Destination; + + /** + * Decodes a Destination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Destination + * @throws {Error} If the payload 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.connectors.v1.Destination; + + /** + * Verifies a Destination message. + * @param message Plain 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 Destination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Destination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Destination; + + /** + * Creates a plain object from a Destination message. Also converts values to other types if specified. + * @param message Destination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Destination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Destination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Destination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SslConfigTemplate. */ + interface ISslConfigTemplate { + + /** SslConfigTemplate sslType */ + sslType?: (google.cloud.connectors.v1.SslType|keyof typeof google.cloud.connectors.v1.SslType|null); + + /** SslConfigTemplate isTlsMandatory */ + isTlsMandatory?: (boolean|null); + + /** SslConfigTemplate serverCertType */ + serverCertType?: (google.cloud.connectors.v1.CertType[]|null); + + /** SslConfigTemplate clientCertType */ + clientCertType?: (google.cloud.connectors.v1.CertType[]|null); + + /** SslConfigTemplate additionalVariables */ + additionalVariables?: (google.cloud.connectors.v1.IConfigVariableTemplate[]|null); + } + + /** Represents a SslConfigTemplate. */ + class SslConfigTemplate implements ISslConfigTemplate { + + /** + * Constructs a new SslConfigTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ISslConfigTemplate); + + /** SslConfigTemplate sslType. */ + public sslType: (google.cloud.connectors.v1.SslType|keyof typeof google.cloud.connectors.v1.SslType); + + /** SslConfigTemplate isTlsMandatory. */ + public isTlsMandatory: boolean; + + /** SslConfigTemplate serverCertType. */ + public serverCertType: google.cloud.connectors.v1.CertType[]; + + /** SslConfigTemplate clientCertType. */ + public clientCertType: google.cloud.connectors.v1.CertType[]; + + /** SslConfigTemplate additionalVariables. */ + public additionalVariables: google.cloud.connectors.v1.IConfigVariableTemplate[]; + + /** + * Creates a new SslConfigTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns SslConfigTemplate instance + */ + public static create(properties?: google.cloud.connectors.v1.ISslConfigTemplate): google.cloud.connectors.v1.SslConfigTemplate; + + /** + * Encodes the specified SslConfigTemplate message. Does not implicitly {@link google.cloud.connectors.v1.SslConfigTemplate.verify|verify} messages. + * @param message SslConfigTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ISslConfigTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslConfigTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SslConfigTemplate.verify|verify} messages. + * @param message SslConfigTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ISslConfigTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslConfigTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslConfigTemplate + * @throws {Error} If the payload is not 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.connectors.v1.SslConfigTemplate; + + /** + * Decodes a SslConfigTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslConfigTemplate + * @throws {Error} If the payload 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.connectors.v1.SslConfigTemplate; + + /** + * Verifies a SslConfigTemplate message. + * @param message Plain 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 SslConfigTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslConfigTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.SslConfigTemplate; + + /** + * Creates a plain object from a SslConfigTemplate message. Also converts values to other types if specified. + * @param message SslConfigTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.SslConfigTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslConfigTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SslConfigTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SslConfig. */ + interface ISslConfig { + + /** SslConfig type */ + type?: (google.cloud.connectors.v1.SslType|keyof typeof google.cloud.connectors.v1.SslType|null); + + /** SslConfig trustModel */ + trustModel?: (google.cloud.connectors.v1.SslConfig.TrustModel|keyof typeof google.cloud.connectors.v1.SslConfig.TrustModel|null); + + /** SslConfig privateServerCertificate */ + privateServerCertificate?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientCertificate */ + clientCertificate?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientPrivateKey */ + clientPrivateKey?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientPrivateKeyPass */ + clientPrivateKeyPass?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig serverCertType */ + serverCertType?: (google.cloud.connectors.v1.CertType|keyof typeof google.cloud.connectors.v1.CertType|null); + + /** SslConfig clientCertType */ + clientCertType?: (google.cloud.connectors.v1.CertType|keyof typeof google.cloud.connectors.v1.CertType|null); + + /** SslConfig useSsl */ + useSsl?: (boolean|null); + + /** SslConfig additionalVariables */ + additionalVariables?: (google.cloud.connectors.v1.IConfigVariable[]|null); + } + + /** Represents a SslConfig. */ + class SslConfig implements ISslConfig { + + /** + * Constructs a new SslConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ISslConfig); + + /** SslConfig type. */ + public type: (google.cloud.connectors.v1.SslType|keyof typeof google.cloud.connectors.v1.SslType); + + /** SslConfig trustModel. */ + public trustModel: (google.cloud.connectors.v1.SslConfig.TrustModel|keyof typeof google.cloud.connectors.v1.SslConfig.TrustModel); + + /** SslConfig privateServerCertificate. */ + public privateServerCertificate?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientCertificate. */ + public clientCertificate?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientPrivateKey. */ + public clientPrivateKey?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientPrivateKeyPass. */ + public clientPrivateKeyPass?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig serverCertType. */ + public serverCertType: (google.cloud.connectors.v1.CertType|keyof typeof google.cloud.connectors.v1.CertType); + + /** SslConfig clientCertType. */ + public clientCertType: (google.cloud.connectors.v1.CertType|keyof typeof google.cloud.connectors.v1.CertType); + + /** SslConfig useSsl. */ + public useSsl: boolean; + + /** SslConfig additionalVariables. */ + public additionalVariables: google.cloud.connectors.v1.IConfigVariable[]; + + /** + * Creates a new SslConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SslConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.ISslConfig): google.cloud.connectors.v1.SslConfig; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.connectors.v1.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslConfig + * @throws {Error} If the payload is not 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.connectors.v1.SslConfig; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslConfig + * @throws {Error} If the payload 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.connectors.v1.SslConfig; + + /** + * Verifies a SslConfig message. + * @param message Plain 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 SslConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.SslConfig; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @param message SslConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SslConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SslConfig { + + /** TrustModel enum. */ + enum TrustModel { + PUBLIC = 0, + PRIVATE = 1, + INSECURE = 2 + } + } + + /** SslType enum. */ + enum SslType { + SSL_TYPE_UNSPECIFIED = 0, + TLS = 1, + MTLS = 2 + } + + /** CertType enum. */ + enum CertType { + CERT_TYPE_UNSPECIFIED = 0, + PEM = 1 + } + + /** Properties of a Connector. */ + interface IConnector { + + /** Connector name */ + name?: (string|null); + + /** Connector createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Connector updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Connector labels */ + labels?: ({ [k: string]: string }|null); + + /** Connector documentationUri */ + documentationUri?: (string|null); + + /** Connector externalUri */ + externalUri?: (string|null); + + /** Connector description */ + description?: (string|null); + + /** Connector webAssetsLocation */ + webAssetsLocation?: (string|null); + + /** Connector displayName */ + displayName?: (string|null); + + /** Connector launchStage */ + launchStage?: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage|null); + } + + /** Represents a Connector. */ + class Connector implements IConnector { + + /** + * Constructs a new Connector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConnector); + + /** Connector name. */ + public name: string; + + /** Connector createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Connector updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Connector labels. */ + public labels: { [k: string]: string }; + + /** Connector documentationUri. */ + public documentationUri: string; + + /** Connector externalUri. */ + public externalUri: string; + + /** Connector description. */ + public description: string; + + /** Connector webAssetsLocation. */ + public webAssetsLocation: string; + + /** Connector displayName. */ + public displayName: string; + + /** Connector launchStage. */ + public launchStage: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage); + + /** + * Creates a new Connector instance using the specified properties. + * @param [properties] Properties to set + * @returns Connector instance + */ + public static create(properties?: google.cloud.connectors.v1.IConnector): google.cloud.connectors.v1.Connector; + + /** + * Encodes the specified Connector message. Does not implicitly {@link google.cloud.connectors.v1.Connector.verify|verify} messages. + * @param message Connector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConnector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Connector message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Connector.verify|verify} messages. + * @param message Connector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConnector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Connector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Connector + * @throws {Error} If the payload is not 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.connectors.v1.Connector; + + /** + * Decodes a Connector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Connector + * @throws {Error} If the payload 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.connectors.v1.Connector; + + /** + * Verifies a Connector message. + * @param message Plain 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 Connector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Connector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Connector; + + /** + * Creates a plain object from a Connector message. Also converts values to other types if specified. + * @param message Connector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Connector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Connector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Connector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectorRequest. */ + interface IGetConnectorRequest { + + /** GetConnectorRequest name */ + name?: (string|null); + } + + /** Represents a GetConnectorRequest. */ + class GetConnectorRequest implements IGetConnectorRequest { + + /** + * Constructs a new GetConnectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetConnectorRequest); + + /** GetConnectorRequest name. */ + public name: string; + + /** + * Creates a new GetConnectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectorRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetConnectorRequest): google.cloud.connectors.v1.GetConnectorRequest; + + /** + * Encodes the specified GetConnectorRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorRequest.verify|verify} messages. + * @param message GetConnectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetConnectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectorRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorRequest.verify|verify} messages. + * @param message GetConnectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetConnectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectorRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetConnectorRequest; + + /** + * Decodes a GetConnectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectorRequest + * @throws {Error} If the payload 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.connectors.v1.GetConnectorRequest; + + /** + * Verifies a GetConnectorRequest message. + * @param message Plain 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 GetConnectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetConnectorRequest; + + /** + * Creates a plain object from a GetConnectorRequest message. Also converts values to other types if specified. + * @param message GetConnectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetConnectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectorsRequest. */ + interface IListConnectorsRequest { + + /** ListConnectorsRequest parent */ + parent?: (string|null); + + /** ListConnectorsRequest pageSize */ + pageSize?: (number|null); + + /** ListConnectorsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListConnectorsRequest. */ + class ListConnectorsRequest implements IListConnectorsRequest { + + /** + * Constructs a new ListConnectorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectorsRequest); + + /** ListConnectorsRequest parent. */ + public parent: string; + + /** ListConnectorsRequest pageSize. */ + public pageSize: number; + + /** ListConnectorsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListConnectorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectorsRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectorsRequest): google.cloud.connectors.v1.ListConnectorsRequest; + + /** + * Encodes the specified ListConnectorsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsRequest.verify|verify} messages. + * @param message ListConnectorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectorsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsRequest.verify|verify} messages. + * @param message ListConnectorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectorsRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectorsRequest; + + /** + * Decodes a ListConnectorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectorsRequest + * @throws {Error} If the payload 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.connectors.v1.ListConnectorsRequest; + + /** + * Verifies a ListConnectorsRequest message. + * @param message Plain 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 ListConnectorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectorsRequest; + + /** + * Creates a plain object from a ListConnectorsRequest message. Also converts values to other types if specified. + * @param message ListConnectorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectorsResponse. */ + interface IListConnectorsResponse { + + /** ListConnectorsResponse connectors */ + connectors?: (google.cloud.connectors.v1.IConnector[]|null); + + /** ListConnectorsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListConnectorsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListConnectorsResponse. */ + class ListConnectorsResponse implements IListConnectorsResponse { + + /** + * Constructs a new ListConnectorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectorsResponse); + + /** ListConnectorsResponse connectors. */ + public connectors: google.cloud.connectors.v1.IConnector[]; + + /** ListConnectorsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListConnectorsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListConnectorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectorsResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectorsResponse): google.cloud.connectors.v1.ListConnectorsResponse; + + /** + * Encodes the specified ListConnectorsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsResponse.verify|verify} messages. + * @param message ListConnectorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectorsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsResponse.verify|verify} messages. + * @param message ListConnectorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectorsResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectorsResponse; + + /** + * Decodes a ListConnectorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectorsResponse + * @throws {Error} If the payload 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.connectors.v1.ListConnectorsResponse; + + /** + * Verifies a ListConnectorsResponse message. + * @param message Plain 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 ListConnectorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectorsResponse; + + /** + * Creates a plain object from a ListConnectorsResponse message. Also converts values to other types if specified. + * @param message ListConnectorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectorVersion. */ + interface IConnectorVersion { + + /** ConnectorVersion name */ + name?: (string|null); + + /** ConnectorVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ConnectorVersion updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectorVersion labels */ + labels?: ({ [k: string]: string }|null); + + /** ConnectorVersion launchStage */ + launchStage?: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage|null); + + /** ConnectorVersion releaseVersion */ + releaseVersion?: (string|null); + + /** ConnectorVersion authConfigTemplates */ + authConfigTemplates?: (google.cloud.connectors.v1.IAuthConfigTemplate[]|null); + + /** ConnectorVersion configVariableTemplates */ + configVariableTemplates?: (google.cloud.connectors.v1.IConfigVariableTemplate[]|null); + + /** ConnectorVersion supportedRuntimeFeatures */ + supportedRuntimeFeatures?: (google.cloud.connectors.v1.ISupportedRuntimeFeatures|null); + + /** ConnectorVersion displayName */ + displayName?: (string|null); + + /** ConnectorVersion egressControlConfig */ + egressControlConfig?: (google.cloud.connectors.v1.IEgressControlConfig|null); + + /** ConnectorVersion roleGrants */ + roleGrants?: (google.cloud.connectors.v1.IRoleGrant[]|null); + + /** ConnectorVersion roleGrant */ + roleGrant?: (google.cloud.connectors.v1.IRoleGrant|null); + + /** ConnectorVersion sslConfigTemplate */ + sslConfigTemplate?: (google.cloud.connectors.v1.ISslConfigTemplate|null); + } + + /** Represents a ConnectorVersion. */ + class ConnectorVersion implements IConnectorVersion { + + /** + * Constructs a new ConnectorVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConnectorVersion); + + /** ConnectorVersion name. */ + public name: string; + + /** ConnectorVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ConnectorVersion updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectorVersion labels. */ + public labels: { [k: string]: string }; + + /** ConnectorVersion launchStage. */ + public launchStage: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage); + + /** ConnectorVersion releaseVersion. */ + public releaseVersion: string; + + /** ConnectorVersion authConfigTemplates. */ + public authConfigTemplates: google.cloud.connectors.v1.IAuthConfigTemplate[]; + + /** ConnectorVersion configVariableTemplates. */ + public configVariableTemplates: google.cloud.connectors.v1.IConfigVariableTemplate[]; + + /** ConnectorVersion supportedRuntimeFeatures. */ + public supportedRuntimeFeatures?: (google.cloud.connectors.v1.ISupportedRuntimeFeatures|null); + + /** ConnectorVersion displayName. */ + public displayName: string; + + /** ConnectorVersion egressControlConfig. */ + public egressControlConfig?: (google.cloud.connectors.v1.IEgressControlConfig|null); + + /** ConnectorVersion roleGrants. */ + public roleGrants: google.cloud.connectors.v1.IRoleGrant[]; + + /** ConnectorVersion roleGrant. */ + public roleGrant?: (google.cloud.connectors.v1.IRoleGrant|null); + + /** ConnectorVersion sslConfigTemplate. */ + public sslConfigTemplate?: (google.cloud.connectors.v1.ISslConfigTemplate|null); + + /** + * Creates a new ConnectorVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorVersion instance + */ + public static create(properties?: google.cloud.connectors.v1.IConnectorVersion): google.cloud.connectors.v1.ConnectorVersion; + + /** + * Encodes the specified ConnectorVersion message. Does not implicitly {@link google.cloud.connectors.v1.ConnectorVersion.verify|verify} messages. + * @param message ConnectorVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConnectorVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorVersion message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectorVersion.verify|verify} messages. + * @param message ConnectorVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConnectorVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorVersion + * @throws {Error} If the payload is not 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.connectors.v1.ConnectorVersion; + + /** + * Decodes a ConnectorVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorVersion + * @throws {Error} If the payload 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.connectors.v1.ConnectorVersion; + + /** + * Verifies a ConnectorVersion message. + * @param message Plain 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 ConnectorVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ConnectorVersion; + + /** + * Creates a plain object from a ConnectorVersion message. Also converts values to other types if specified. + * @param message ConnectorVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ConnectorVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectorVersionRequest. */ + interface IGetConnectorVersionRequest { + + /** GetConnectorVersionRequest name */ + name?: (string|null); + + /** GetConnectorVersionRequest view */ + view?: (google.cloud.connectors.v1.ConnectorVersionView|keyof typeof google.cloud.connectors.v1.ConnectorVersionView|null); + } + + /** Represents a GetConnectorVersionRequest. */ + class GetConnectorVersionRequest implements IGetConnectorVersionRequest { + + /** + * Constructs a new GetConnectorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetConnectorVersionRequest); + + /** GetConnectorVersionRequest name. */ + public name: string; + + /** GetConnectorVersionRequest view. */ + public view: (google.cloud.connectors.v1.ConnectorVersionView|keyof typeof google.cloud.connectors.v1.ConnectorVersionView); + + /** + * Creates a new GetConnectorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectorVersionRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetConnectorVersionRequest): google.cloud.connectors.v1.GetConnectorVersionRequest; + + /** + * Encodes the specified GetConnectorVersionRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorVersionRequest.verify|verify} messages. + * @param message GetConnectorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetConnectorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorVersionRequest.verify|verify} messages. + * @param message GetConnectorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetConnectorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectorVersionRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetConnectorVersionRequest; + + /** + * Decodes a GetConnectorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectorVersionRequest + * @throws {Error} If the payload 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.connectors.v1.GetConnectorVersionRequest; + + /** + * Verifies a GetConnectorVersionRequest message. + * @param message Plain 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 GetConnectorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetConnectorVersionRequest; + + /** + * Creates a plain object from a GetConnectorVersionRequest message. Also converts values to other types if specified. + * @param message GetConnectorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetConnectorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectorVersionsRequest. */ + interface IListConnectorVersionsRequest { + + /** ListConnectorVersionsRequest parent */ + parent?: (string|null); + + /** ListConnectorVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListConnectorVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListConnectorVersionsRequest view */ + view?: (google.cloud.connectors.v1.ConnectorVersionView|keyof typeof google.cloud.connectors.v1.ConnectorVersionView|null); + } + + /** Represents a ListConnectorVersionsRequest. */ + class ListConnectorVersionsRequest implements IListConnectorVersionsRequest { + + /** + * Constructs a new ListConnectorVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectorVersionsRequest); + + /** ListConnectorVersionsRequest parent. */ + public parent: string; + + /** ListConnectorVersionsRequest pageSize. */ + public pageSize: number; + + /** ListConnectorVersionsRequest pageToken. */ + public pageToken: string; + + /** ListConnectorVersionsRequest view. */ + public view: (google.cloud.connectors.v1.ConnectorVersionView|keyof typeof google.cloud.connectors.v1.ConnectorVersionView); + + /** + * Creates a new ListConnectorVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectorVersionsRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectorVersionsRequest): google.cloud.connectors.v1.ListConnectorVersionsRequest; + + /** + * Encodes the specified ListConnectorVersionsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsRequest.verify|verify} messages. + * @param message ListConnectorVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsRequest.verify|verify} messages. + * @param message ListConnectorVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectorVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectorVersionsRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectorVersionsRequest; + + /** + * Decodes a ListConnectorVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectorVersionsRequest + * @throws {Error} If the payload 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.connectors.v1.ListConnectorVersionsRequest; + + /** + * Verifies a ListConnectorVersionsRequest message. + * @param message Plain 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 ListConnectorVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectorVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectorVersionsRequest; + + /** + * Creates a plain object from a ListConnectorVersionsRequest message. Also converts values to other types if specified. + * @param message ListConnectorVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectorVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectorVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectorVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectorVersionsResponse. */ + interface IListConnectorVersionsResponse { + + /** ListConnectorVersionsResponse connectorVersions */ + connectorVersions?: (google.cloud.connectors.v1.IConnectorVersion[]|null); + + /** ListConnectorVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListConnectorVersionsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListConnectorVersionsResponse. */ + class ListConnectorVersionsResponse implements IListConnectorVersionsResponse { + + /** + * Constructs a new ListConnectorVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectorVersionsResponse); + + /** ListConnectorVersionsResponse connectorVersions. */ + public connectorVersions: google.cloud.connectors.v1.IConnectorVersion[]; + + /** ListConnectorVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListConnectorVersionsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListConnectorVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectorVersionsResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectorVersionsResponse): google.cloud.connectors.v1.ListConnectorVersionsResponse; + + /** + * Encodes the specified ListConnectorVersionsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsResponse.verify|verify} messages. + * @param message ListConnectorVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsResponse.verify|verify} messages. + * @param message ListConnectorVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectorVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectorVersionsResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectorVersionsResponse; + + /** + * Decodes a ListConnectorVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectorVersionsResponse + * @throws {Error} If the payload 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.connectors.v1.ListConnectorVersionsResponse; + + /** + * Verifies a ListConnectorVersionsResponse message. + * @param message Plain 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 ListConnectorVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectorVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectorVersionsResponse; + + /** + * Creates a plain object from a ListConnectorVersionsResponse message. Also converts values to other types if specified. + * @param message ListConnectorVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectorVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectorVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectorVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SupportedRuntimeFeatures. */ + interface ISupportedRuntimeFeatures { + + /** SupportedRuntimeFeatures entityApis */ + entityApis?: (boolean|null); + + /** SupportedRuntimeFeatures actionApis */ + actionApis?: (boolean|null); + + /** SupportedRuntimeFeatures sqlQuery */ + sqlQuery?: (boolean|null); + } + + /** Represents a SupportedRuntimeFeatures. */ + class SupportedRuntimeFeatures implements ISupportedRuntimeFeatures { + + /** + * Constructs a new SupportedRuntimeFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ISupportedRuntimeFeatures); + + /** SupportedRuntimeFeatures entityApis. */ + public entityApis: boolean; + + /** SupportedRuntimeFeatures actionApis. */ + public actionApis: boolean; + + /** SupportedRuntimeFeatures sqlQuery. */ + public sqlQuery: boolean; + + /** + * Creates a new SupportedRuntimeFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns SupportedRuntimeFeatures instance + */ + public static create(properties?: google.cloud.connectors.v1.ISupportedRuntimeFeatures): google.cloud.connectors.v1.SupportedRuntimeFeatures; + + /** + * Encodes the specified SupportedRuntimeFeatures message. Does not implicitly {@link google.cloud.connectors.v1.SupportedRuntimeFeatures.verify|verify} messages. + * @param message SupportedRuntimeFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ISupportedRuntimeFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupportedRuntimeFeatures message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SupportedRuntimeFeatures.verify|verify} messages. + * @param message SupportedRuntimeFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ISupportedRuntimeFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupportedRuntimeFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupportedRuntimeFeatures + * @throws {Error} If the payload is not 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.connectors.v1.SupportedRuntimeFeatures; + + /** + * Decodes a SupportedRuntimeFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupportedRuntimeFeatures + * @throws {Error} If the payload 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.connectors.v1.SupportedRuntimeFeatures; + + /** + * Verifies a SupportedRuntimeFeatures message. + * @param message Plain 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 SupportedRuntimeFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupportedRuntimeFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.SupportedRuntimeFeatures; + + /** + * Creates a plain object from a SupportedRuntimeFeatures message. Also converts values to other types if specified. + * @param message SupportedRuntimeFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.SupportedRuntimeFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupportedRuntimeFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupportedRuntimeFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressControlConfig. */ + interface IEgressControlConfig { + + /** EgressControlConfig backends */ + backends?: (string|null); + + /** EgressControlConfig extractionRules */ + extractionRules?: (google.cloud.connectors.v1.IExtractionRules|null); + } + + /** Represents an EgressControlConfig. */ + class EgressControlConfig implements IEgressControlConfig { + + /** + * Constructs a new EgressControlConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IEgressControlConfig); + + /** EgressControlConfig backends. */ + public backends?: (string|null); + + /** EgressControlConfig extractionRules. */ + public extractionRules?: (google.cloud.connectors.v1.IExtractionRules|null); + + /** EgressControlConfig oneofBackends. */ + public oneofBackends?: ("backends"|"extractionRules"); + + /** + * Creates a new EgressControlConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressControlConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.IEgressControlConfig): google.cloud.connectors.v1.EgressControlConfig; + + /** + * Encodes the specified EgressControlConfig message. Does not implicitly {@link google.cloud.connectors.v1.EgressControlConfig.verify|verify} messages. + * @param message EgressControlConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IEgressControlConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressControlConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.EgressControlConfig.verify|verify} messages. + * @param message EgressControlConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IEgressControlConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressControlConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressControlConfig + * @throws {Error} If the payload is not 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.connectors.v1.EgressControlConfig; + + /** + * Decodes an EgressControlConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressControlConfig + * @throws {Error} If the payload 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.connectors.v1.EgressControlConfig; + + /** + * Verifies an EgressControlConfig message. + * @param message Plain 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 EgressControlConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressControlConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.EgressControlConfig; + + /** + * Creates a plain object from an EgressControlConfig message. Also converts values to other types if specified. + * @param message EgressControlConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.EgressControlConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressControlConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressControlConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExtractionRules. */ + interface IExtractionRules { + + /** ExtractionRules extractionRule */ + extractionRule?: (google.cloud.connectors.v1.IExtractionRule[]|null); + } + + /** Represents an ExtractionRules. */ + class ExtractionRules implements IExtractionRules { + + /** + * Constructs a new ExtractionRules. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IExtractionRules); + + /** ExtractionRules extractionRule. */ + public extractionRule: google.cloud.connectors.v1.IExtractionRule[]; + + /** + * Creates a new ExtractionRules instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtractionRules instance + */ + public static create(properties?: google.cloud.connectors.v1.IExtractionRules): google.cloud.connectors.v1.ExtractionRules; + + /** + * Encodes the specified ExtractionRules message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRules.verify|verify} messages. + * @param message ExtractionRules message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IExtractionRules, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtractionRules message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRules.verify|verify} messages. + * @param message ExtractionRules message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IExtractionRules, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtractionRules message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtractionRules + * @throws {Error} If the payload is not 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.connectors.v1.ExtractionRules; + + /** + * Decodes an ExtractionRules message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtractionRules + * @throws {Error} If the payload 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.connectors.v1.ExtractionRules; + + /** + * Verifies an ExtractionRules message. + * @param message Plain 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 ExtractionRules message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtractionRules + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ExtractionRules; + + /** + * Creates a plain object from an ExtractionRules message. Also converts values to other types if specified. + * @param message ExtractionRules + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ExtractionRules, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtractionRules to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtractionRules + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExtractionRule. */ + interface IExtractionRule { + + /** ExtractionRule source */ + source?: (google.cloud.connectors.v1.ExtractionRule.ISource|null); + + /** ExtractionRule extractionRegex */ + extractionRegex?: (string|null); + } + + /** Represents an ExtractionRule. */ + class ExtractionRule implements IExtractionRule { + + /** + * Constructs a new ExtractionRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IExtractionRule); + + /** ExtractionRule source. */ + public source?: (google.cloud.connectors.v1.ExtractionRule.ISource|null); + + /** ExtractionRule extractionRegex. */ + public extractionRegex: string; + + /** + * Creates a new ExtractionRule instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtractionRule instance + */ + public static create(properties?: google.cloud.connectors.v1.IExtractionRule): google.cloud.connectors.v1.ExtractionRule; + + /** + * Encodes the specified ExtractionRule message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.verify|verify} messages. + * @param message ExtractionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IExtractionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtractionRule message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.verify|verify} messages. + * @param message ExtractionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IExtractionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtractionRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtractionRule + * @throws {Error} If the payload is not 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.connectors.v1.ExtractionRule; + + /** + * Decodes an ExtractionRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtractionRule + * @throws {Error} If the payload 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.connectors.v1.ExtractionRule; + + /** + * Verifies an ExtractionRule message. + * @param message Plain 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 ExtractionRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtractionRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ExtractionRule; + + /** + * Creates a plain object from an ExtractionRule message. Also converts values to other types if specified. + * @param message ExtractionRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ExtractionRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtractionRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtractionRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtractionRule { + + /** Properties of a Source. */ + interface ISource { + + /** Source sourceType */ + sourceType?: (google.cloud.connectors.v1.ExtractionRule.SourceType|keyof typeof google.cloud.connectors.v1.ExtractionRule.SourceType|null); + + /** Source fieldId */ + fieldId?: (string|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ExtractionRule.ISource); + + /** Source sourceType. */ + public sourceType: (google.cloud.connectors.v1.ExtractionRule.SourceType|keyof typeof google.cloud.connectors.v1.ExtractionRule.SourceType); + + /** Source fieldId. */ + public fieldId: string; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.cloud.connectors.v1.ExtractionRule.ISource): google.cloud.connectors.v1.ExtractionRule.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ExtractionRule.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ExtractionRule.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @throws {Error} If the payload is not 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.connectors.v1.ExtractionRule.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @throws {Error} If the payload 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.connectors.v1.ExtractionRule.Source; + + /** + * Verifies a Source message. + * @param message Plain 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 Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ExtractionRule.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ExtractionRule.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Source + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** SourceType enum. */ + enum SourceType { + SOURCE_TYPE_UNSPECIFIED = 0, + CONFIG_VARIABLE = 1 + } + } + + /** ConnectorVersionView enum. */ + enum ConnectorVersionView { + CONNECTOR_VERSION_VIEW_UNSPECIFIED = 0, + CONNECTOR_VERSION_VIEW_BASIC = 1, + CONNECTOR_VERSION_VIEW_FULL = 2 + } + + /** Represents a Connectors */ + class Connectors extends $protobuf.rpc.Service { + + /** + * Constructs a new Connectors 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 Connectors 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): Connectors; + + /** + * Calls ListConnections. + * @param request ListConnectionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConnectionsResponse + */ + public listConnections(request: google.cloud.connectors.v1.IListConnectionsRequest, callback: google.cloud.connectors.v1.Connectors.ListConnectionsCallback): void; + + /** + * Calls ListConnections. + * @param request ListConnectionsRequest message or plain object + * @returns Promise + */ + public listConnections(request: google.cloud.connectors.v1.IListConnectionsRequest): Promise; + + /** + * Calls GetConnection. + * @param request GetConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Connection + */ + public getConnection(request: google.cloud.connectors.v1.IGetConnectionRequest, callback: google.cloud.connectors.v1.Connectors.GetConnectionCallback): void; + + /** + * Calls GetConnection. + * @param request GetConnectionRequest message or plain object + * @returns Promise + */ + public getConnection(request: google.cloud.connectors.v1.IGetConnectionRequest): Promise; + + /** + * Calls CreateConnection. + * @param request CreateConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createConnection(request: google.cloud.connectors.v1.ICreateConnectionRequest, callback: google.cloud.connectors.v1.Connectors.CreateConnectionCallback): void; + + /** + * Calls CreateConnection. + * @param request CreateConnectionRequest message or plain object + * @returns Promise + */ + public createConnection(request: google.cloud.connectors.v1.ICreateConnectionRequest): Promise; + + /** + * Calls UpdateConnection. + * @param request UpdateConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateConnection(request: google.cloud.connectors.v1.IUpdateConnectionRequest, callback: google.cloud.connectors.v1.Connectors.UpdateConnectionCallback): void; + + /** + * Calls UpdateConnection. + * @param request UpdateConnectionRequest message or plain object + * @returns Promise + */ + public updateConnection(request: google.cloud.connectors.v1.IUpdateConnectionRequest): Promise; + + /** + * Calls DeleteConnection. + * @param request DeleteConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteConnection(request: google.cloud.connectors.v1.IDeleteConnectionRequest, callback: google.cloud.connectors.v1.Connectors.DeleteConnectionCallback): void; + + /** + * Calls DeleteConnection. + * @param request DeleteConnectionRequest message or plain object + * @returns Promise + */ + public deleteConnection(request: google.cloud.connectors.v1.IDeleteConnectionRequest): Promise; + + /** + * Calls ListProviders. + * @param request ListProvidersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProvidersResponse + */ + public listProviders(request: google.cloud.connectors.v1.IListProvidersRequest, callback: google.cloud.connectors.v1.Connectors.ListProvidersCallback): void; + + /** + * Calls ListProviders. + * @param request ListProvidersRequest message or plain object + * @returns Promise + */ + public listProviders(request: google.cloud.connectors.v1.IListProvidersRequest): Promise; + + /** + * Calls GetProvider. + * @param request GetProviderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Provider + */ + public getProvider(request: google.cloud.connectors.v1.IGetProviderRequest, callback: google.cloud.connectors.v1.Connectors.GetProviderCallback): void; + + /** + * Calls GetProvider. + * @param request GetProviderRequest message or plain object + * @returns Promise + */ + public getProvider(request: google.cloud.connectors.v1.IGetProviderRequest): Promise; + + /** + * Calls ListConnectors. + * @param request ListConnectorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConnectorsResponse + */ + public listConnectors(request: google.cloud.connectors.v1.IListConnectorsRequest, callback: google.cloud.connectors.v1.Connectors.ListConnectorsCallback): void; + + /** + * Calls ListConnectors. + * @param request ListConnectorsRequest message or plain object + * @returns Promise + */ + public listConnectors(request: google.cloud.connectors.v1.IListConnectorsRequest): Promise; + + /** + * Calls GetConnector. + * @param request GetConnectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Connector + */ + public getConnector(request: google.cloud.connectors.v1.IGetConnectorRequest, callback: google.cloud.connectors.v1.Connectors.GetConnectorCallback): void; + + /** + * Calls GetConnector. + * @param request GetConnectorRequest message or plain object + * @returns Promise + */ + public getConnector(request: google.cloud.connectors.v1.IGetConnectorRequest): Promise; + + /** + * Calls ListConnectorVersions. + * @param request ListConnectorVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConnectorVersionsResponse + */ + public listConnectorVersions(request: google.cloud.connectors.v1.IListConnectorVersionsRequest, callback: google.cloud.connectors.v1.Connectors.ListConnectorVersionsCallback): void; + + /** + * Calls ListConnectorVersions. + * @param request ListConnectorVersionsRequest message or plain object + * @returns Promise + */ + public listConnectorVersions(request: google.cloud.connectors.v1.IListConnectorVersionsRequest): Promise; + + /** + * Calls GetConnectorVersion. + * @param request GetConnectorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectorVersion + */ + public getConnectorVersion(request: google.cloud.connectors.v1.IGetConnectorVersionRequest, callback: google.cloud.connectors.v1.Connectors.GetConnectorVersionCallback): void; + + /** + * Calls GetConnectorVersion. + * @param request GetConnectorVersionRequest message or plain object + * @returns Promise + */ + public getConnectorVersion(request: google.cloud.connectors.v1.IGetConnectorVersionRequest): Promise; + + /** + * Calls GetConnectionSchemaMetadata. + * @param request GetConnectionSchemaMetadataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectionSchemaMetadata + */ + public getConnectionSchemaMetadata(request: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, callback: google.cloud.connectors.v1.Connectors.GetConnectionSchemaMetadataCallback): void; + + /** + * Calls GetConnectionSchemaMetadata. + * @param request GetConnectionSchemaMetadataRequest message or plain object + * @returns Promise + */ + public getConnectionSchemaMetadata(request: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest): Promise; + + /** + * Calls RefreshConnectionSchemaMetadata. + * @param request RefreshConnectionSchemaMetadataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public refreshConnectionSchemaMetadata(request: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, callback: google.cloud.connectors.v1.Connectors.RefreshConnectionSchemaMetadataCallback): void; + + /** + * Calls RefreshConnectionSchemaMetadata. + * @param request RefreshConnectionSchemaMetadataRequest message or plain object + * @returns Promise + */ + public refreshConnectionSchemaMetadata(request: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest): Promise; + + /** + * Calls ListRuntimeEntitySchemas. + * @param request ListRuntimeEntitySchemasRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRuntimeEntitySchemasResponse + */ + public listRuntimeEntitySchemas(request: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, callback: google.cloud.connectors.v1.Connectors.ListRuntimeEntitySchemasCallback): void; + + /** + * Calls ListRuntimeEntitySchemas. + * @param request ListRuntimeEntitySchemasRequest message or plain object + * @returns Promise + */ + public listRuntimeEntitySchemas(request: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest): Promise; + + /** + * Calls ListRuntimeActionSchemas. + * @param request ListRuntimeActionSchemasRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRuntimeActionSchemasResponse + */ + public listRuntimeActionSchemas(request: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, callback: google.cloud.connectors.v1.Connectors.ListRuntimeActionSchemasCallback): void; + + /** + * Calls ListRuntimeActionSchemas. + * @param request ListRuntimeActionSchemasRequest message or plain object + * @returns Promise + */ + public listRuntimeActionSchemas(request: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest): Promise; + + /** + * Calls GetRuntimeConfig. + * @param request GetRuntimeConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RuntimeConfig + */ + public getRuntimeConfig(request: google.cloud.connectors.v1.IGetRuntimeConfigRequest, callback: google.cloud.connectors.v1.Connectors.GetRuntimeConfigCallback): void; + + /** + * Calls GetRuntimeConfig. + * @param request GetRuntimeConfigRequest message or plain object + * @returns Promise + */ + public getRuntimeConfig(request: google.cloud.connectors.v1.IGetRuntimeConfigRequest): Promise; + + /** + * Calls GetGlobalSettings. + * @param request GetGlobalSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Settings + */ + public getGlobalSettings(request: google.cloud.connectors.v1.IGetGlobalSettingsRequest, callback: google.cloud.connectors.v1.Connectors.GetGlobalSettingsCallback): void; + + /** + * Calls GetGlobalSettings. + * @param request GetGlobalSettingsRequest message or plain object + * @returns Promise + */ + public getGlobalSettings(request: google.cloud.connectors.v1.IGetGlobalSettingsRequest): Promise; + } + + namespace Connectors { + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnections}. + * @param error Error, if any + * @param [response] ListConnectionsResponse + */ + type ListConnectionsCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListConnectionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnection}. + * @param error Error, if any + * @param [response] Connection + */ + type GetConnectionCallback = (error: (Error|null), response?: google.cloud.connectors.v1.Connection) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|createConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|updateConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|deleteConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listProviders}. + * @param error Error, if any + * @param [response] ListProvidersResponse + */ + type ListProvidersCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListProvidersResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getProvider}. + * @param error Error, if any + * @param [response] Provider + */ + type GetProviderCallback = (error: (Error|null), response?: google.cloud.connectors.v1.Provider) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnectors}. + * @param error Error, if any + * @param [response] ListConnectorsResponse + */ + type ListConnectorsCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListConnectorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnector}. + * @param error Error, if any + * @param [response] Connector + */ + type GetConnectorCallback = (error: (Error|null), response?: google.cloud.connectors.v1.Connector) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnectorVersions}. + * @param error Error, if any + * @param [response] ListConnectorVersionsResponse + */ + type ListConnectorVersionsCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListConnectorVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnectorVersion}. + * @param error Error, if any + * @param [response] ConnectorVersion + */ + type GetConnectorVersionCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ConnectorVersion) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnectionSchemaMetadata}. + * @param error Error, if any + * @param [response] ConnectionSchemaMetadata + */ + type GetConnectionSchemaMetadataCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ConnectionSchemaMetadata) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|refreshConnectionSchemaMetadata}. + * @param error Error, if any + * @param [response] Operation + */ + type RefreshConnectionSchemaMetadataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listRuntimeEntitySchemas}. + * @param error Error, if any + * @param [response] ListRuntimeEntitySchemasResponse + */ + type ListRuntimeEntitySchemasCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listRuntimeActionSchemas}. + * @param error Error, if any + * @param [response] ListRuntimeActionSchemasResponse + */ + type ListRuntimeActionSchemasCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListRuntimeActionSchemasResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getRuntimeConfig}. + * @param error Error, if any + * @param [response] RuntimeConfig + */ + type GetRuntimeConfigCallback = (error: (Error|null), response?: google.cloud.connectors.v1.RuntimeConfig) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getGlobalSettings}. + * @param error Error, if any + * @param [response] Settings + */ + type GetGlobalSettingsCallback = (error: (Error|null), response?: google.cloud.connectors.v1.Settings) => void; + } + + /** Properties of a Provider. */ + interface IProvider { + + /** Provider name */ + name?: (string|null); + + /** Provider createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Provider updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Provider labels */ + labels?: ({ [k: string]: string }|null); + + /** Provider documentationUri */ + documentationUri?: (string|null); + + /** Provider externalUri */ + externalUri?: (string|null); + + /** Provider description */ + description?: (string|null); + + /** Provider webAssetsLocation */ + webAssetsLocation?: (string|null); + + /** Provider displayName */ + displayName?: (string|null); + + /** Provider launchStage */ + launchStage?: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage|null); + } + + /** Represents a Provider. */ + class Provider implements IProvider { + + /** + * Constructs a new Provider. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IProvider); + + /** Provider name. */ + public name: string; + + /** Provider createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Provider updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Provider labels. */ + public labels: { [k: string]: string }; + + /** Provider documentationUri. */ + public documentationUri: string; + + /** Provider externalUri. */ + public externalUri: string; + + /** Provider description. */ + public description: string; + + /** Provider webAssetsLocation. */ + public webAssetsLocation: string; + + /** Provider displayName. */ + public displayName: string; + + /** Provider launchStage. */ + public launchStage: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage); + + /** + * Creates a new Provider instance using the specified properties. + * @param [properties] Properties to set + * @returns Provider instance + */ + public static create(properties?: google.cloud.connectors.v1.IProvider): google.cloud.connectors.v1.Provider; + + /** + * Encodes the specified Provider message. Does not implicitly {@link google.cloud.connectors.v1.Provider.verify|verify} messages. + * @param message Provider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Provider message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Provider.verify|verify} messages. + * @param message Provider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Provider message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Provider + * @throws {Error} If the payload is not 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.connectors.v1.Provider; + + /** + * Decodes a Provider message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Provider + * @throws {Error} If the payload 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.connectors.v1.Provider; + + /** + * Verifies a Provider message. + * @param message Plain 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 Provider message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Provider + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Provider; + + /** + * Creates a plain object from a Provider message. Also converts values to other types if specified. + * @param message Provider + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Provider, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Provider to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Provider + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProviderRequest. */ + interface IGetProviderRequest { + + /** GetProviderRequest name */ + name?: (string|null); + } + + /** Represents a GetProviderRequest. */ + class GetProviderRequest implements IGetProviderRequest { + + /** + * Constructs a new GetProviderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetProviderRequest); + + /** GetProviderRequest name. */ + public name: string; + + /** + * Creates a new GetProviderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProviderRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetProviderRequest): google.cloud.connectors.v1.GetProviderRequest; + + /** + * Encodes the specified GetProviderRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetProviderRequest.verify|verify} messages. + * @param message GetProviderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetProviderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProviderRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetProviderRequest.verify|verify} messages. + * @param message GetProviderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetProviderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProviderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProviderRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetProviderRequest; + + /** + * Decodes a GetProviderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProviderRequest + * @throws {Error} If the payload 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.connectors.v1.GetProviderRequest; + + /** + * Verifies a GetProviderRequest message. + * @param message Plain 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 GetProviderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProviderRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetProviderRequest; + + /** + * Creates a plain object from a GetProviderRequest message. Also converts values to other types if specified. + * @param message GetProviderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetProviderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProviderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProviderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProvidersRequest. */ + interface IListProvidersRequest { + + /** ListProvidersRequest parent */ + parent?: (string|null); + + /** ListProvidersRequest pageSize */ + pageSize?: (number|null); + + /** ListProvidersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProvidersRequest. */ + class ListProvidersRequest implements IListProvidersRequest { + + /** + * Constructs a new ListProvidersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListProvidersRequest); + + /** ListProvidersRequest parent. */ + public parent: string; + + /** ListProvidersRequest pageSize. */ + public pageSize: number; + + /** ListProvidersRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProvidersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProvidersRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListProvidersRequest): google.cloud.connectors.v1.ListProvidersRequest; + + /** + * Encodes the specified ListProvidersRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersRequest.verify|verify} messages. + * @param message ListProvidersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListProvidersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProvidersRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersRequest.verify|verify} messages. + * @param message ListProvidersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListProvidersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProvidersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProvidersRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListProvidersRequest; + + /** + * Decodes a ListProvidersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProvidersRequest + * @throws {Error} If the payload 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.connectors.v1.ListProvidersRequest; + + /** + * Verifies a ListProvidersRequest message. + * @param message Plain 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 ListProvidersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProvidersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListProvidersRequest; + + /** + * Creates a plain object from a ListProvidersRequest message. Also converts values to other types if specified. + * @param message ListProvidersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListProvidersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProvidersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProvidersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProvidersResponse. */ + interface IListProvidersResponse { + + /** ListProvidersResponse providers */ + providers?: (google.cloud.connectors.v1.IProvider[]|null); + + /** ListProvidersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListProvidersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListProvidersResponse. */ + class ListProvidersResponse implements IListProvidersResponse { + + /** + * Constructs a new ListProvidersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListProvidersResponse); + + /** ListProvidersResponse providers. */ + public providers: google.cloud.connectors.v1.IProvider[]; + + /** ListProvidersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListProvidersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListProvidersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProvidersResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListProvidersResponse): google.cloud.connectors.v1.ListProvidersResponse; + + /** + * Encodes the specified ListProvidersResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersResponse.verify|verify} messages. + * @param message ListProvidersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListProvidersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProvidersResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersResponse.verify|verify} messages. + * @param message ListProvidersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListProvidersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProvidersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProvidersResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListProvidersResponse; + + /** + * Decodes a ListProvidersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProvidersResponse + * @throws {Error} If the payload 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.connectors.v1.ListProvidersResponse; + + /** + * Verifies a ListProvidersResponse message. + * @param message Plain 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 ListProvidersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProvidersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListProvidersResponse; + + /** + * Creates a plain object from a ListProvidersResponse message. Also converts values to other types if specified. + * @param message ListProvidersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListProvidersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProvidersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProvidersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRuntimeConfigRequest. */ + interface IGetRuntimeConfigRequest { + + /** GetRuntimeConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetRuntimeConfigRequest. */ + class GetRuntimeConfigRequest implements IGetRuntimeConfigRequest { + + /** + * Constructs a new GetRuntimeConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetRuntimeConfigRequest); + + /** GetRuntimeConfigRequest name. */ + public name: string; + + /** + * Creates a new GetRuntimeConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRuntimeConfigRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetRuntimeConfigRequest): google.cloud.connectors.v1.GetRuntimeConfigRequest; + + /** + * Encodes the specified GetRuntimeConfigRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetRuntimeConfigRequest.verify|verify} messages. + * @param message GetRuntimeConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetRuntimeConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRuntimeConfigRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetRuntimeConfigRequest.verify|verify} messages. + * @param message GetRuntimeConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetRuntimeConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRuntimeConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRuntimeConfigRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetRuntimeConfigRequest; + + /** + * Decodes a GetRuntimeConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRuntimeConfigRequest + * @throws {Error} If the payload 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.connectors.v1.GetRuntimeConfigRequest; + + /** + * Verifies a GetRuntimeConfigRequest message. + * @param message Plain 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 GetRuntimeConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRuntimeConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetRuntimeConfigRequest; + + /** + * Creates a plain object from a GetRuntimeConfigRequest message. Also converts values to other types if specified. + * @param message GetRuntimeConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetRuntimeConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRuntimeConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRuntimeConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RuntimeConfig. */ + interface IRuntimeConfig { + + /** RuntimeConfig locationId */ + locationId?: (string|null); + + /** RuntimeConfig conndTopic */ + conndTopic?: (string|null); + + /** RuntimeConfig conndSubscription */ + conndSubscription?: (string|null); + + /** RuntimeConfig controlPlaneTopic */ + controlPlaneTopic?: (string|null); + + /** RuntimeConfig controlPlaneSubscription */ + controlPlaneSubscription?: (string|null); + + /** RuntimeConfig runtimeEndpoint */ + runtimeEndpoint?: (string|null); + + /** RuntimeConfig state */ + state?: (google.cloud.connectors.v1.RuntimeConfig.State|keyof typeof google.cloud.connectors.v1.RuntimeConfig.State|null); + + /** RuntimeConfig schemaGcsBucket */ + schemaGcsBucket?: (string|null); + + /** RuntimeConfig serviceDirectory */ + serviceDirectory?: (string|null); + + /** RuntimeConfig name */ + name?: (string|null); + } + + /** Represents a RuntimeConfig. */ + class RuntimeConfig implements IRuntimeConfig { + + /** + * Constructs a new RuntimeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IRuntimeConfig); + + /** RuntimeConfig locationId. */ + public locationId: string; + + /** RuntimeConfig conndTopic. */ + public conndTopic: string; + + /** RuntimeConfig conndSubscription. */ + public conndSubscription: string; + + /** RuntimeConfig controlPlaneTopic. */ + public controlPlaneTopic: string; + + /** RuntimeConfig controlPlaneSubscription. */ + public controlPlaneSubscription: string; + + /** RuntimeConfig runtimeEndpoint. */ + public runtimeEndpoint: string; + + /** RuntimeConfig state. */ + public state: (google.cloud.connectors.v1.RuntimeConfig.State|keyof typeof google.cloud.connectors.v1.RuntimeConfig.State); + + /** RuntimeConfig schemaGcsBucket. */ + public schemaGcsBucket: string; + + /** RuntimeConfig serviceDirectory. */ + public serviceDirectory: string; + + /** RuntimeConfig name. */ + public name: string; + + /** + * Creates a new RuntimeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.IRuntimeConfig): google.cloud.connectors.v1.RuntimeConfig; + + /** + * Encodes the specified RuntimeConfig message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeConfig.verify|verify} messages. + * @param message RuntimeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IRuntimeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeConfig.verify|verify} messages. + * @param message RuntimeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IRuntimeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeConfig + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeConfig; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeConfig + * @throws {Error} If the payload 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.connectors.v1.RuntimeConfig; + + /** + * Verifies a RuntimeConfig message. + * @param message Plain 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 RuntimeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeConfig; + + /** + * Creates a plain object from a RuntimeConfig message. Also converts values to other types if specified. + * @param message RuntimeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RuntimeConfig { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + INACTIVE = 1, + ACTIVATING = 2, + ACTIVE = 3, + CREATING = 4, + DELETING = 5, + UPDATING = 6 + } + } + + /** Properties of a GetGlobalSettingsRequest. */ + interface IGetGlobalSettingsRequest { + + /** GetGlobalSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetGlobalSettingsRequest. */ + class GetGlobalSettingsRequest implements IGetGlobalSettingsRequest { + + /** + * Constructs a new GetGlobalSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetGlobalSettingsRequest); + + /** GetGlobalSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetGlobalSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlobalSettingsRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetGlobalSettingsRequest): google.cloud.connectors.v1.GetGlobalSettingsRequest; + + /** + * Encodes the specified GetGlobalSettingsRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetGlobalSettingsRequest.verify|verify} messages. + * @param message GetGlobalSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetGlobalSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlobalSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetGlobalSettingsRequest.verify|verify} messages. + * @param message GetGlobalSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetGlobalSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlobalSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlobalSettingsRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetGlobalSettingsRequest; + + /** + * Decodes a GetGlobalSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlobalSettingsRequest + * @throws {Error} If the payload 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.connectors.v1.GetGlobalSettingsRequest; + + /** + * Verifies a GetGlobalSettingsRequest message. + * @param message Plain 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 GetGlobalSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlobalSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetGlobalSettingsRequest; + + /** + * Creates a plain object from a GetGlobalSettingsRequest message. Also converts values to other types if specified. + * @param message GetGlobalSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetGlobalSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlobalSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGlobalSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Settings. */ + interface ISettings { + + /** Settings name */ + name?: (string|null); + + /** Settings vpcsc */ + vpcsc?: (boolean|null); + + /** Settings payg */ + payg?: (boolean|null); + } + + /** Represents a Settings. */ + class Settings implements ISettings { + + /** + * Constructs a new Settings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ISettings); + + /** Settings name. */ + public name: string; + + /** Settings vpcsc. */ + public vpcsc: boolean; + + /** Settings payg. */ + public payg: boolean; + + /** + * Creates a new Settings instance using the specified properties. + * @param [properties] Properties to set + * @returns Settings instance + */ + public static create(properties?: google.cloud.connectors.v1.ISettings): google.cloud.connectors.v1.Settings; + + /** + * Encodes the specified Settings message. Does not implicitly {@link google.cloud.connectors.v1.Settings.verify|verify} messages. + * @param message Settings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Settings.verify|verify} messages. + * @param message Settings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Settings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Settings + * @throws {Error} If the payload is not 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.connectors.v1.Settings; + + /** + * Decodes a Settings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Settings + * @throws {Error} If the payload 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.connectors.v1.Settings; + + /** + * Verifies a Settings message. + * @param message Plain 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 Settings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Settings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Settings; + + /** + * Creates a plain object from a Settings message. Also converts values to other types if specified. + * @param message Settings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Settings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Settings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Settings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain 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 Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain 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 LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 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 }; + + /** + * 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. */ + 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); + + /** FileDescriptorProto edition */ + edition?: (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; + + /** FileDescriptorProto edition. */ + public edition: 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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; + } + } + + /** 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 }; + + /** + * 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. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 { + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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; + } + } + + /** 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 { + + /** 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 deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: 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 }; + + /** + * 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. */ + 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 unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** 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 }; + + /** + * 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 { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + } + + /** 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 }; + + /** + * 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. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (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 deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + 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 }; + + /** + * 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. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 { + + /** 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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; + } + } + + /** 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 }; + + /** + * 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 { + + /** 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 }; + + /** + * 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; + } + } + + /** 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 }; + + /** + * 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 { + + /** 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); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|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; + + /** 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 + * @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 }; + + /** + * 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 + } + } + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not 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.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload 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.Struct; + + /** + * Verifies a Struct message. + * @param message Plain 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 Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not 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.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload 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.Value; + + /** + * Verifies a Value message. + * @param message Plain 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 Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not 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.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload 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.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain 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 ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an 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 }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 }; + + /** + * 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-connectors/protos/protos.js b/packages/google-cloud-connectors/protos/protos.js new file mode 100644 index 00000000000..6d0d124bfc7 --- /dev/null +++ b/packages/google-cloud-connectors/protos/protos.js @@ -0,0 +1,39768 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_connectors_protos || ($protobuf.roots._google_cloud_connectors_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.connectors = (function() { + + /** + * Namespace connectors. + * @memberof google.cloud + * @namespace + */ + var connectors = {}; + + connectors.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.connectors + * @namespace + */ + var v1 = {}; + + v1.AuthConfig = (function() { + + /** + * Properties of an AuthConfig. + * @memberof google.cloud.connectors.v1 + * @interface IAuthConfig + * @property {google.cloud.connectors.v1.AuthType|null} [authType] AuthConfig authType + * @property {google.cloud.connectors.v1.AuthConfig.IUserPassword|null} [userPassword] AuthConfig userPassword + * @property {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer|null} [oauth2JwtBearer] AuthConfig oauth2JwtBearer + * @property {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials|null} [oauth2ClientCredentials] AuthConfig oauth2ClientCredentials + * @property {google.cloud.connectors.v1.AuthConfig.ISshPublicKey|null} [sshPublicKey] AuthConfig sshPublicKey + * @property {Array.|null} [additionalVariables] AuthConfig additionalVariables + */ + + /** + * Constructs a new AuthConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an AuthConfig. + * @implements IAuthConfig + * @constructor + * @param {google.cloud.connectors.v1.IAuthConfig=} [properties] Properties to set + */ + function AuthConfig(properties) { + this.additionalVariables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthConfig authType. + * @member {google.cloud.connectors.v1.AuthType} authType + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.authType = 0; + + /** + * AuthConfig userPassword. + * @member {google.cloud.connectors.v1.AuthConfig.IUserPassword|null|undefined} userPassword + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.userPassword = null; + + /** + * AuthConfig oauth2JwtBearer. + * @member {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer|null|undefined} oauth2JwtBearer + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.oauth2JwtBearer = null; + + /** + * AuthConfig oauth2ClientCredentials. + * @member {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials|null|undefined} oauth2ClientCredentials + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.oauth2ClientCredentials = null; + + /** + * AuthConfig sshPublicKey. + * @member {google.cloud.connectors.v1.AuthConfig.ISshPublicKey|null|undefined} sshPublicKey + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.sshPublicKey = null; + + /** + * AuthConfig additionalVariables. + * @member {Array.} additionalVariables + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.additionalVariables = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AuthConfig type. + * @member {"userPassword"|"oauth2JwtBearer"|"oauth2ClientCredentials"|"sshPublicKey"|undefined} type + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + Object.defineProperty(AuthConfig.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["userPassword", "oauth2JwtBearer", "oauth2ClientCredentials", "sshPublicKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {google.cloud.connectors.v1.IAuthConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig} AuthConfig instance + */ + AuthConfig.create = function create(properties) { + return new AuthConfig(properties); + }; + + /** + * Encodes the specified AuthConfig message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {google.cloud.connectors.v1.IAuthConfig} message AuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authType != null && Object.hasOwnProperty.call(message, "authType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.authType); + if (message.userPassword != null && Object.hasOwnProperty.call(message, "userPassword")) + $root.google.cloud.connectors.v1.AuthConfig.UserPassword.encode(message.userPassword, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.oauth2JwtBearer != null && Object.hasOwnProperty.call(message, "oauth2JwtBearer")) + $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.encode(message.oauth2JwtBearer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.oauth2ClientCredentials != null && Object.hasOwnProperty.call(message, "oauth2ClientCredentials")) + $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.encode(message.oauth2ClientCredentials, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.additionalVariables != null && message.additionalVariables.length) + for (var i = 0; i < message.additionalVariables.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariable.encode(message.additionalVariables[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sshPublicKey != null && Object.hasOwnProperty.call(message, "sshPublicKey")) + $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey.encode(message.sshPublicKey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuthConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {google.cloud.connectors.v1.IAuthConfig} message AuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig} AuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthConfig.decode = function 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.connectors.v1.AuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.authType = reader.int32(); + break; + } + case 2: { + message.userPassword = $root.google.cloud.connectors.v1.AuthConfig.UserPassword.decode(reader, reader.uint32()); + break; + } + case 3: { + message.oauth2JwtBearer = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.decode(reader, reader.uint32()); + break; + } + case 4: { + message.oauth2ClientCredentials = $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.decode(reader, reader.uint32()); + break; + } + case 6: { + message.sshPublicKey = $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.additionalVariables && message.additionalVariables.length)) + message.additionalVariables = []; + message.additionalVariables.push($root.google.cloud.connectors.v1.ConfigVariable.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig} AuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.authType != null && message.hasOwnProperty("authType")) + switch (message.authType) { + default: + return "authType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.userPassword != null && message.hasOwnProperty("userPassword")) { + properties.type = 1; + { + var error = $root.google.cloud.connectors.v1.AuthConfig.UserPassword.verify(message.userPassword); + if (error) + return "userPassword." + error; + } + } + if (message.oauth2JwtBearer != null && message.hasOwnProperty("oauth2JwtBearer")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.verify(message.oauth2JwtBearer); + if (error) + return "oauth2JwtBearer." + error; + } + } + if (message.oauth2ClientCredentials != null && message.hasOwnProperty("oauth2ClientCredentials")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.verify(message.oauth2ClientCredentials); + if (error) + return "oauth2ClientCredentials." + error; + } + } + if (message.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey.verify(message.sshPublicKey); + if (error) + return "sshPublicKey." + error; + } + } + if (message.additionalVariables != null && message.hasOwnProperty("additionalVariables")) { + if (!Array.isArray(message.additionalVariables)) + return "additionalVariables: array expected"; + for (var i = 0; i < message.additionalVariables.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariable.verify(message.additionalVariables[i]); + if (error) + return "additionalVariables." + error; + } + } + return null; + }; + + /** + * Creates an AuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig} AuthConfig + */ + AuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig(); + switch (object.authType) { + default: + if (typeof object.authType === "number") { + message.authType = object.authType; + break; + } + break; + case "AUTH_TYPE_UNSPECIFIED": + case 0: + message.authType = 0; + break; + case "USER_PASSWORD": + case 1: + message.authType = 1; + break; + case "OAUTH2_JWT_BEARER": + case 2: + message.authType = 2; + break; + case "OAUTH2_CLIENT_CREDENTIALS": + case 3: + message.authType = 3; + break; + case "SSH_PUBLIC_KEY": + case 4: + message.authType = 4; + break; + case "OAUTH2_AUTH_CODE_FLOW": + case 5: + message.authType = 5; + break; + } + if (object.userPassword != null) { + if (typeof object.userPassword !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.userPassword: object expected"); + message.userPassword = $root.google.cloud.connectors.v1.AuthConfig.UserPassword.fromObject(object.userPassword); + } + if (object.oauth2JwtBearer != null) { + if (typeof object.oauth2JwtBearer !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.oauth2JwtBearer: object expected"); + message.oauth2JwtBearer = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.fromObject(object.oauth2JwtBearer); + } + if (object.oauth2ClientCredentials != null) { + if (typeof object.oauth2ClientCredentials !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.oauth2ClientCredentials: object expected"); + message.oauth2ClientCredentials = $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.fromObject(object.oauth2ClientCredentials); + } + if (object.sshPublicKey != null) { + if (typeof object.sshPublicKey !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.sshPublicKey: object expected"); + message.sshPublicKey = $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey.fromObject(object.sshPublicKey); + } + if (object.additionalVariables) { + if (!Array.isArray(object.additionalVariables)) + throw TypeError(".google.cloud.connectors.v1.AuthConfig.additionalVariables: array expected"); + message.additionalVariables = []; + for (var i = 0; i < object.additionalVariables.length; ++i) { + if (typeof object.additionalVariables[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.additionalVariables: object expected"); + message.additionalVariables[i] = $root.google.cloud.connectors.v1.ConfigVariable.fromObject(object.additionalVariables[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {google.cloud.connectors.v1.AuthConfig} message AuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalVariables = []; + if (options.defaults) + object.authType = options.enums === String ? "AUTH_TYPE_UNSPECIFIED" : 0; + if (message.authType != null && message.hasOwnProperty("authType")) + object.authType = options.enums === String ? $root.google.cloud.connectors.v1.AuthType[message.authType] === undefined ? message.authType : $root.google.cloud.connectors.v1.AuthType[message.authType] : message.authType; + if (message.userPassword != null && message.hasOwnProperty("userPassword")) { + object.userPassword = $root.google.cloud.connectors.v1.AuthConfig.UserPassword.toObject(message.userPassword, options); + if (options.oneofs) + object.type = "userPassword"; + } + if (message.oauth2JwtBearer != null && message.hasOwnProperty("oauth2JwtBearer")) { + object.oauth2JwtBearer = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.toObject(message.oauth2JwtBearer, options); + if (options.oneofs) + object.type = "oauth2JwtBearer"; + } + if (message.oauth2ClientCredentials != null && message.hasOwnProperty("oauth2ClientCredentials")) { + object.oauth2ClientCredentials = $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.toObject(message.oauth2ClientCredentials, options); + if (options.oneofs) + object.type = "oauth2ClientCredentials"; + } + if (message.additionalVariables && message.additionalVariables.length) { + object.additionalVariables = []; + for (var j = 0; j < message.additionalVariables.length; ++j) + object.additionalVariables[j] = $root.google.cloud.connectors.v1.ConfigVariable.toObject(message.additionalVariables[j], options); + } + if (message.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) { + object.sshPublicKey = $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey.toObject(message.sshPublicKey, options); + if (options.oneofs) + object.type = "sshPublicKey"; + } + return object; + }; + + /** + * Converts this AuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + * @returns {Object.} JSON object + */ + AuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig"; + }; + + AuthConfig.UserPassword = (function() { + + /** + * Properties of a UserPassword. + * @memberof google.cloud.connectors.v1.AuthConfig + * @interface IUserPassword + * @property {string|null} [username] UserPassword username + * @property {google.cloud.connectors.v1.ISecret|null} [password] UserPassword password + */ + + /** + * Constructs a new UserPassword. + * @memberof google.cloud.connectors.v1.AuthConfig + * @classdesc Represents a UserPassword. + * @implements IUserPassword + * @constructor + * @param {google.cloud.connectors.v1.AuthConfig.IUserPassword=} [properties] Properties to set + */ + function UserPassword(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]]; + } + + /** + * UserPassword username. + * @member {string} username + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @instance + */ + UserPassword.prototype.username = ""; + + /** + * UserPassword password. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} password + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @instance + */ + UserPassword.prototype.password = null; + + /** + * Creates a new UserPassword instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IUserPassword=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig.UserPassword} UserPassword instance + */ + UserPassword.create = function create(properties) { + return new UserPassword(properties); + }; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.UserPassword.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + $root.google.cloud.connectors.v1.Secret.encode(message.password, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.UserPassword.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decode = function 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.connectors.v1.AuthConfig.UserPassword(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + case 2: { + message.password = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserPassword message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserPassword.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.password); + if (error) + return "password." + error; + } + return null; + }; + + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig.UserPassword} UserPassword + */ + UserPassword.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig.UserPassword) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig.UserPassword(); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) { + if (typeof object.password !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.UserPassword.password: object expected"); + message.password = $root.google.cloud.connectors.v1.Secret.fromObject(object.password); + } + return message; + }; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {google.cloud.connectors.v1.AuthConfig.UserPassword} message UserPassword + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserPassword.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.password = null; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = $root.google.cloud.connectors.v1.Secret.toObject(message.password, options); + return object; + }; + + /** + * Converts this UserPassword to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @instance + * @returns {Object.} JSON object + */ + UserPassword.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserPassword + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig.UserPassword"; + }; + + return UserPassword; + })(); + + AuthConfig.Oauth2JwtBearer = (function() { + + /** + * Properties of an Oauth2JwtBearer. + * @memberof google.cloud.connectors.v1.AuthConfig + * @interface IOauth2JwtBearer + * @property {google.cloud.connectors.v1.ISecret|null} [clientKey] Oauth2JwtBearer clientKey + * @property {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims|null} [jwtClaims] Oauth2JwtBearer jwtClaims + */ + + /** + * Constructs a new Oauth2JwtBearer. + * @memberof google.cloud.connectors.v1.AuthConfig + * @classdesc Represents an Oauth2JwtBearer. + * @implements IOauth2JwtBearer + * @constructor + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer=} [properties] Properties to set + */ + function Oauth2JwtBearer(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]]; + } + + /** + * Oauth2JwtBearer clientKey. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} clientKey + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @instance + */ + Oauth2JwtBearer.prototype.clientKey = null; + + /** + * Oauth2JwtBearer jwtClaims. + * @member {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims|null|undefined} jwtClaims + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @instance + */ + Oauth2JwtBearer.prototype.jwtClaims = null; + + /** + * Creates a new Oauth2JwtBearer instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer} Oauth2JwtBearer instance + */ + Oauth2JwtBearer.create = function create(properties) { + return new Oauth2JwtBearer(properties); + }; + + /** + * Encodes the specified Oauth2JwtBearer message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer} message Oauth2JwtBearer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) + $root.google.cloud.connectors.v1.Secret.encode(message.clientKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.jwtClaims != null && Object.hasOwnProperty.call(message, "jwtClaims")) + $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.encode(message.jwtClaims, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Oauth2JwtBearer message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer} message Oauth2JwtBearer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2JwtBearer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer} Oauth2JwtBearer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearer.decode = function 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.connectors.v1.AuthConfig.Oauth2JwtBearer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.clientKey = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 2: { + message.jwtClaims = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2JwtBearer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer} Oauth2JwtBearer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2JwtBearer message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2JwtBearer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.clientKey); + if (error) + return "clientKey." + error; + } + if (message.jwtClaims != null && message.hasOwnProperty("jwtClaims")) { + var error = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.verify(message.jwtClaims); + if (error) + return "jwtClaims." + error; + } + return null; + }; + + /** + * Creates an Oauth2JwtBearer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer} Oauth2JwtBearer + */ + Oauth2JwtBearer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer(); + if (object.clientKey != null) { + if (typeof object.clientKey !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.clientKey: object expected"); + message.clientKey = $root.google.cloud.connectors.v1.Secret.fromObject(object.clientKey); + } + if (object.jwtClaims != null) { + if (typeof object.jwtClaims !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.jwtClaims: object expected"); + message.jwtClaims = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.fromObject(object.jwtClaims); + } + return message; + }; + + /** + * Creates a plain object from an Oauth2JwtBearer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer} message Oauth2JwtBearer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2JwtBearer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientKey = null; + object.jwtClaims = null; + } + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + object.clientKey = $root.google.cloud.connectors.v1.Secret.toObject(message.clientKey, options); + if (message.jwtClaims != null && message.hasOwnProperty("jwtClaims")) + object.jwtClaims = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.toObject(message.jwtClaims, options); + return object; + }; + + /** + * Converts this Oauth2JwtBearer to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @instance + * @returns {Object.} JSON object + */ + Oauth2JwtBearer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2JwtBearer + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2JwtBearer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer"; + }; + + Oauth2JwtBearer.JwtClaims = (function() { + + /** + * Properties of a JwtClaims. + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @interface IJwtClaims + * @property {string|null} [issuer] JwtClaims issuer + * @property {string|null} [subject] JwtClaims subject + * @property {string|null} [audience] JwtClaims audience + */ + + /** + * Constructs a new JwtClaims. + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @classdesc Represents a JwtClaims. + * @implements IJwtClaims + * @constructor + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims=} [properties] Properties to set + */ + function JwtClaims(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]]; + } + + /** + * JwtClaims issuer. + * @member {string} issuer + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @instance + */ + JwtClaims.prototype.issuer = ""; + + /** + * JwtClaims subject. + * @member {string} subject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @instance + */ + JwtClaims.prototype.subject = ""; + + /** + * JwtClaims audience. + * @member {string} audience + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @instance + */ + JwtClaims.prototype.audience = ""; + + /** + * Creates a new JwtClaims instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims} JwtClaims instance + */ + JwtClaims.create = function create(properties) { + return new JwtClaims(properties); + }; + + /** + * Encodes the specified JwtClaims message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims} message JwtClaims message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JwtClaims.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.issuer); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subject); + if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.audience); + return writer; + }; + + /** + * Encodes the specified JwtClaims message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims} message JwtClaims message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JwtClaims.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JwtClaims message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims} JwtClaims + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JwtClaims.decode = function 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.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.issuer = reader.string(); + break; + } + case 2: { + message.subject = reader.string(); + break; + } + case 3: { + message.audience = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JwtClaims message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims} JwtClaims + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JwtClaims.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JwtClaims message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JwtClaims.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.issuer != null && message.hasOwnProperty("issuer")) + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + if (message.subject != null && message.hasOwnProperty("subject")) + if (!$util.isString(message.subject)) + return "subject: string expected"; + if (message.audience != null && message.hasOwnProperty("audience")) + if (!$util.isString(message.audience)) + return "audience: string expected"; + return null; + }; + + /** + * Creates a JwtClaims message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims} JwtClaims + */ + JwtClaims.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims(); + if (object.issuer != null) + message.issuer = String(object.issuer); + if (object.subject != null) + message.subject = String(object.subject); + if (object.audience != null) + message.audience = String(object.audience); + return message; + }; + + /** + * Creates a plain object from a JwtClaims message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims} message JwtClaims + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JwtClaims.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.issuer = ""; + object.subject = ""; + object.audience = ""; + } + if (message.issuer != null && message.hasOwnProperty("issuer")) + object.issuer = message.issuer; + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = message.subject; + if (message.audience != null && message.hasOwnProperty("audience")) + object.audience = message.audience; + return object; + }; + + /** + * Converts this JwtClaims to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @instance + * @returns {Object.} JSON object + */ + JwtClaims.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JwtClaims + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JwtClaims.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims"; + }; + + return JwtClaims; + })(); + + return Oauth2JwtBearer; + })(); + + AuthConfig.Oauth2ClientCredentials = (function() { + + /** + * Properties of an Oauth2ClientCredentials. + * @memberof google.cloud.connectors.v1.AuthConfig + * @interface IOauth2ClientCredentials + * @property {string|null} [clientId] Oauth2ClientCredentials clientId + * @property {google.cloud.connectors.v1.ISecret|null} [clientSecret] Oauth2ClientCredentials clientSecret + */ + + /** + * Constructs a new Oauth2ClientCredentials. + * @memberof google.cloud.connectors.v1.AuthConfig + * @classdesc Represents an Oauth2ClientCredentials. + * @implements IOauth2ClientCredentials + * @constructor + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials=} [properties] Properties to set + */ + function Oauth2ClientCredentials(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]]; + } + + /** + * Oauth2ClientCredentials clientId. + * @member {string} clientId + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @instance + */ + Oauth2ClientCredentials.prototype.clientId = ""; + + /** + * Oauth2ClientCredentials clientSecret. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} clientSecret + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @instance + */ + Oauth2ClientCredentials.prototype.clientSecret = null; + + /** + * Creates a new Oauth2ClientCredentials instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials} Oauth2ClientCredentials instance + */ + Oauth2ClientCredentials.create = function create(properties) { + return new Oauth2ClientCredentials(properties); + }; + + /** + * Encodes the specified Oauth2ClientCredentials message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials} message Oauth2ClientCredentials message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2ClientCredentials.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientSecret != null && Object.hasOwnProperty.call(message, "clientSecret")) + $root.google.cloud.connectors.v1.Secret.encode(message.clientSecret, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Oauth2ClientCredentials message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials} message Oauth2ClientCredentials message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2ClientCredentials.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2ClientCredentials message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials} Oauth2ClientCredentials + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2ClientCredentials.decode = function 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.connectors.v1.AuthConfig.Oauth2ClientCredentials(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.clientSecret = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2ClientCredentials message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials} Oauth2ClientCredentials + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2ClientCredentials.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2ClientCredentials message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2ClientCredentials.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.clientSecret); + if (error) + return "clientSecret." + error; + } + return null; + }; + + /** + * Creates an Oauth2ClientCredentials message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials} Oauth2ClientCredentials + */ + Oauth2ClientCredentials.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientSecret != null) { + if (typeof object.clientSecret !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.clientSecret: object expected"); + message.clientSecret = $root.google.cloud.connectors.v1.Secret.fromObject(object.clientSecret); + } + return message; + }; + + /** + * Creates a plain object from an Oauth2ClientCredentials message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials} message Oauth2ClientCredentials + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2ClientCredentials.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.clientSecret = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) + object.clientSecret = $root.google.cloud.connectors.v1.Secret.toObject(message.clientSecret, options); + return object; + }; + + /** + * Converts this Oauth2ClientCredentials to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @instance + * @returns {Object.} JSON object + */ + Oauth2ClientCredentials.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2ClientCredentials + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2ClientCredentials.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials"; + }; + + return Oauth2ClientCredentials; + })(); + + AuthConfig.SshPublicKey = (function() { + + /** + * Properties of a SshPublicKey. + * @memberof google.cloud.connectors.v1.AuthConfig + * @interface ISshPublicKey + * @property {string|null} [username] SshPublicKey username + * @property {google.cloud.connectors.v1.ISecret|null} [sshClientCert] SshPublicKey sshClientCert + * @property {string|null} [certType] SshPublicKey certType + * @property {google.cloud.connectors.v1.ISecret|null} [sshClientCertPass] SshPublicKey sshClientCertPass + */ + + /** + * Constructs a new SshPublicKey. + * @memberof google.cloud.connectors.v1.AuthConfig + * @classdesc Represents a SshPublicKey. + * @implements ISshPublicKey + * @constructor + * @param {google.cloud.connectors.v1.AuthConfig.ISshPublicKey=} [properties] Properties to set + */ + function SshPublicKey(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]]; + } + + /** + * SshPublicKey username. + * @member {string} username + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @instance + */ + SshPublicKey.prototype.username = ""; + + /** + * SshPublicKey sshClientCert. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} sshClientCert + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @instance + */ + SshPublicKey.prototype.sshClientCert = null; + + /** + * SshPublicKey certType. + * @member {string} certType + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @instance + */ + SshPublicKey.prototype.certType = ""; + + /** + * SshPublicKey sshClientCertPass. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} sshClientCertPass + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @instance + */ + SshPublicKey.prototype.sshClientCertPass = null; + + /** + * Creates a new SshPublicKey instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {google.cloud.connectors.v1.AuthConfig.ISshPublicKey=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig.SshPublicKey} SshPublicKey instance + */ + SshPublicKey.create = function create(properties) { + return new SshPublicKey(properties); + }; + + /** + * Encodes the specified SshPublicKey message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.SshPublicKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {google.cloud.connectors.v1.AuthConfig.ISshPublicKey} message SshPublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SshPublicKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.sshClientCert != null && Object.hasOwnProperty.call(message, "sshClientCert")) + $root.google.cloud.connectors.v1.Secret.encode(message.sshClientCert, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.certType != null && Object.hasOwnProperty.call(message, "certType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.certType); + if (message.sshClientCertPass != null && Object.hasOwnProperty.call(message, "sshClientCertPass")) + $root.google.cloud.connectors.v1.Secret.encode(message.sshClientCertPass, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SshPublicKey message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.SshPublicKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {google.cloud.connectors.v1.AuthConfig.ISshPublicKey} message SshPublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SshPublicKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig.SshPublicKey} SshPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SshPublicKey.decode = function 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.connectors.v1.AuthConfig.SshPublicKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + case 3: { + message.sshClientCert = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 4: { + message.certType = reader.string(); + break; + } + case 5: { + message.sshClientCertPass = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig.SshPublicKey} SshPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SshPublicKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SshPublicKey message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SshPublicKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.sshClientCert != null && message.hasOwnProperty("sshClientCert")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.sshClientCert); + if (error) + return "sshClientCert." + error; + } + if (message.certType != null && message.hasOwnProperty("certType")) + if (!$util.isString(message.certType)) + return "certType: string expected"; + if (message.sshClientCertPass != null && message.hasOwnProperty("sshClientCertPass")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.sshClientCertPass); + if (error) + return "sshClientCertPass." + error; + } + return null; + }; + + /** + * Creates a SshPublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig.SshPublicKey} SshPublicKey + */ + SshPublicKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey(); + if (object.username != null) + message.username = String(object.username); + if (object.sshClientCert != null) { + if (typeof object.sshClientCert !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.SshPublicKey.sshClientCert: object expected"); + message.sshClientCert = $root.google.cloud.connectors.v1.Secret.fromObject(object.sshClientCert); + } + if (object.certType != null) + message.certType = String(object.certType); + if (object.sshClientCertPass != null) { + if (typeof object.sshClientCertPass !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.SshPublicKey.sshClientCertPass: object expected"); + message.sshClientCertPass = $root.google.cloud.connectors.v1.Secret.fromObject(object.sshClientCertPass); + } + return message; + }; + + /** + * Creates a plain object from a SshPublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {google.cloud.connectors.v1.AuthConfig.SshPublicKey} message SshPublicKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SshPublicKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.sshClientCert = null; + object.certType = ""; + object.sshClientCertPass = null; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.sshClientCert != null && message.hasOwnProperty("sshClientCert")) + object.sshClientCert = $root.google.cloud.connectors.v1.Secret.toObject(message.sshClientCert, options); + if (message.certType != null && message.hasOwnProperty("certType")) + object.certType = message.certType; + if (message.sshClientCertPass != null && message.hasOwnProperty("sshClientCertPass")) + object.sshClientCertPass = $root.google.cloud.connectors.v1.Secret.toObject(message.sshClientCertPass, options); + return object; + }; + + /** + * Converts this SshPublicKey to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @instance + * @returns {Object.} JSON object + */ + SshPublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SshPublicKey + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SshPublicKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig.SshPublicKey"; + }; + + return SshPublicKey; + })(); + + return AuthConfig; + })(); + + v1.AuthConfigTemplate = (function() { + + /** + * Properties of an AuthConfigTemplate. + * @memberof google.cloud.connectors.v1 + * @interface IAuthConfigTemplate + * @property {google.cloud.connectors.v1.AuthType|null} [authType] AuthConfigTemplate authType + * @property {Array.|null} [configVariableTemplates] AuthConfigTemplate configVariableTemplates + * @property {string|null} [displayName] AuthConfigTemplate displayName + * @property {string|null} [description] AuthConfigTemplate description + */ + + /** + * Constructs a new AuthConfigTemplate. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an AuthConfigTemplate. + * @implements IAuthConfigTemplate + * @constructor + * @param {google.cloud.connectors.v1.IAuthConfigTemplate=} [properties] Properties to set + */ + function AuthConfigTemplate(properties) { + this.configVariableTemplates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthConfigTemplate authType. + * @member {google.cloud.connectors.v1.AuthType} authType + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @instance + */ + AuthConfigTemplate.prototype.authType = 0; + + /** + * AuthConfigTemplate configVariableTemplates. + * @member {Array.} configVariableTemplates + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @instance + */ + AuthConfigTemplate.prototype.configVariableTemplates = $util.emptyArray; + + /** + * AuthConfigTemplate displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @instance + */ + AuthConfigTemplate.prototype.displayName = ""; + + /** + * AuthConfigTemplate description. + * @member {string} description + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @instance + */ + AuthConfigTemplate.prototype.description = ""; + + /** + * Creates a new AuthConfigTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {google.cloud.connectors.v1.IAuthConfigTemplate=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfigTemplate} AuthConfigTemplate instance + */ + AuthConfigTemplate.create = function create(properties) { + return new AuthConfigTemplate(properties); + }; + + /** + * Encodes the specified AuthConfigTemplate message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfigTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {google.cloud.connectors.v1.IAuthConfigTemplate} message AuthConfigTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthConfigTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authType != null && Object.hasOwnProperty.call(message, "authType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.authType); + if (message.configVariableTemplates != null && message.configVariableTemplates.length) + for (var i = 0; i < message.configVariableTemplates.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariableTemplate.encode(message.configVariableTemplates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + return writer; + }; + + /** + * Encodes the specified AuthConfigTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfigTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {google.cloud.connectors.v1.IAuthConfigTemplate} message AuthConfigTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthConfigTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthConfigTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfigTemplate} AuthConfigTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthConfigTemplate.decode = function 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.connectors.v1.AuthConfigTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.authType = reader.int32(); + break; + } + case 2: { + if (!(message.configVariableTemplates && message.configVariableTemplates.length)) + message.configVariableTemplates = []; + message.configVariableTemplates.push($root.google.cloud.connectors.v1.ConfigVariableTemplate.decode(reader, reader.uint32())); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthConfigTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfigTemplate} AuthConfigTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthConfigTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthConfigTemplate message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthConfigTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authType != null && message.hasOwnProperty("authType")) + switch (message.authType) { + default: + return "authType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.configVariableTemplates != null && message.hasOwnProperty("configVariableTemplates")) { + if (!Array.isArray(message.configVariableTemplates)) + return "configVariableTemplates: array expected"; + for (var i = 0; i < message.configVariableTemplates.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariableTemplate.verify(message.configVariableTemplates[i]); + if (error) + return "configVariableTemplates." + error; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an AuthConfigTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfigTemplate} AuthConfigTemplate + */ + AuthConfigTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfigTemplate) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfigTemplate(); + switch (object.authType) { + default: + if (typeof object.authType === "number") { + message.authType = object.authType; + break; + } + break; + case "AUTH_TYPE_UNSPECIFIED": + case 0: + message.authType = 0; + break; + case "USER_PASSWORD": + case 1: + message.authType = 1; + break; + case "OAUTH2_JWT_BEARER": + case 2: + message.authType = 2; + break; + case "OAUTH2_CLIENT_CREDENTIALS": + case 3: + message.authType = 3; + break; + case "SSH_PUBLIC_KEY": + case 4: + message.authType = 4; + break; + case "OAUTH2_AUTH_CODE_FLOW": + case 5: + message.authType = 5; + break; + } + if (object.configVariableTemplates) { + if (!Array.isArray(object.configVariableTemplates)) + throw TypeError(".google.cloud.connectors.v1.AuthConfigTemplate.configVariableTemplates: array expected"); + message.configVariableTemplates = []; + for (var i = 0; i < object.configVariableTemplates.length; ++i) { + if (typeof object.configVariableTemplates[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfigTemplate.configVariableTemplates: object expected"); + message.configVariableTemplates[i] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.fromObject(object.configVariableTemplates[i]); + } + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an AuthConfigTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {google.cloud.connectors.v1.AuthConfigTemplate} message AuthConfigTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthConfigTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.configVariableTemplates = []; + if (options.defaults) { + object.authType = options.enums === String ? "AUTH_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.description = ""; + } + if (message.authType != null && message.hasOwnProperty("authType")) + object.authType = options.enums === String ? $root.google.cloud.connectors.v1.AuthType[message.authType] === undefined ? message.authType : $root.google.cloud.connectors.v1.AuthType[message.authType] : message.authType; + if (message.configVariableTemplates && message.configVariableTemplates.length) { + object.configVariableTemplates = []; + for (var j = 0; j < message.configVariableTemplates.length; ++j) + object.configVariableTemplates[j] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.toObject(message.configVariableTemplates[j], options); + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this AuthConfigTemplate to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @instance + * @returns {Object.} JSON object + */ + AuthConfigTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthConfigTemplate + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthConfigTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfigTemplate"; + }; + + return AuthConfigTemplate; + })(); + + /** + * AuthType enum. + * @name google.cloud.connectors.v1.AuthType + * @enum {number} + * @property {number} AUTH_TYPE_UNSPECIFIED=0 AUTH_TYPE_UNSPECIFIED value + * @property {number} USER_PASSWORD=1 USER_PASSWORD value + * @property {number} OAUTH2_JWT_BEARER=2 OAUTH2_JWT_BEARER value + * @property {number} OAUTH2_CLIENT_CREDENTIALS=3 OAUTH2_CLIENT_CREDENTIALS value + * @property {number} SSH_PUBLIC_KEY=4 SSH_PUBLIC_KEY value + * @property {number} OAUTH2_AUTH_CODE_FLOW=5 OAUTH2_AUTH_CODE_FLOW value + */ + v1.AuthType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_PASSWORD"] = 1; + values[valuesById[2] = "OAUTH2_JWT_BEARER"] = 2; + values[valuesById[3] = "OAUTH2_CLIENT_CREDENTIALS"] = 3; + values[valuesById[4] = "SSH_PUBLIC_KEY"] = 4; + values[valuesById[5] = "OAUTH2_AUTH_CODE_FLOW"] = 5; + return values; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.connectors.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.connectors.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {google.cloud.connectors.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.connectors.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {google.cloud.connectors.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {google.cloud.connectors.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.connectors.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.connectors.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.connectors.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {google.cloud.connectors.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.ConfigVariableTemplate = (function() { + + /** + * Properties of a ConfigVariableTemplate. + * @memberof google.cloud.connectors.v1 + * @interface IConfigVariableTemplate + * @property {string|null} [key] ConfigVariableTemplate key + * @property {google.cloud.connectors.v1.ConfigVariableTemplate.ValueType|null} [valueType] ConfigVariableTemplate valueType + * @property {string|null} [displayName] ConfigVariableTemplate displayName + * @property {string|null} [description] ConfigVariableTemplate description + * @property {string|null} [validationRegex] ConfigVariableTemplate validationRegex + * @property {boolean|null} [required] ConfigVariableTemplate required + * @property {google.cloud.connectors.v1.IRoleGrant|null} [roleGrant] ConfigVariableTemplate roleGrant + * @property {Array.|null} [enumOptions] ConfigVariableTemplate enumOptions + * @property {google.cloud.connectors.v1.IAuthorizationCodeLink|null} [authorizationCodeLink] ConfigVariableTemplate authorizationCodeLink + * @property {google.cloud.connectors.v1.ConfigVariableTemplate.State|null} [state] ConfigVariableTemplate state + * @property {boolean|null} [isAdvanced] ConfigVariableTemplate isAdvanced + */ + + /** + * Constructs a new ConfigVariableTemplate. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ConfigVariableTemplate. + * @implements IConfigVariableTemplate + * @constructor + * @param {google.cloud.connectors.v1.IConfigVariableTemplate=} [properties] Properties to set + */ + function ConfigVariableTemplate(properties) { + this.enumOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfigVariableTemplate key. + * @member {string} key + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.key = ""; + + /** + * ConfigVariableTemplate valueType. + * @member {google.cloud.connectors.v1.ConfigVariableTemplate.ValueType} valueType + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.valueType = 0; + + /** + * ConfigVariableTemplate displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.displayName = ""; + + /** + * ConfigVariableTemplate description. + * @member {string} description + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.description = ""; + + /** + * ConfigVariableTemplate validationRegex. + * @member {string} validationRegex + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.validationRegex = ""; + + /** + * ConfigVariableTemplate required. + * @member {boolean} required + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.required = false; + + /** + * ConfigVariableTemplate roleGrant. + * @member {google.cloud.connectors.v1.IRoleGrant|null|undefined} roleGrant + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.roleGrant = null; + + /** + * ConfigVariableTemplate enumOptions. + * @member {Array.} enumOptions + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.enumOptions = $util.emptyArray; + + /** + * ConfigVariableTemplate authorizationCodeLink. + * @member {google.cloud.connectors.v1.IAuthorizationCodeLink|null|undefined} authorizationCodeLink + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.authorizationCodeLink = null; + + /** + * ConfigVariableTemplate state. + * @member {google.cloud.connectors.v1.ConfigVariableTemplate.State} state + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.state = 0; + + /** + * ConfigVariableTemplate isAdvanced. + * @member {boolean} isAdvanced + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.isAdvanced = false; + + /** + * Creates a new ConfigVariableTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {google.cloud.connectors.v1.IConfigVariableTemplate=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ConfigVariableTemplate} ConfigVariableTemplate instance + */ + ConfigVariableTemplate.create = function create(properties) { + return new ConfigVariableTemplate(properties); + }; + + /** + * Encodes the specified ConfigVariableTemplate message. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariableTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {google.cloud.connectors.v1.IConfigVariableTemplate} message ConfigVariableTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigVariableTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.valueType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.validationRegex != null && Object.hasOwnProperty.call(message, "validationRegex")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.validationRegex); + if (message.required != null && Object.hasOwnProperty.call(message, "required")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.required); + if (message.roleGrant != null && Object.hasOwnProperty.call(message, "roleGrant")) + $root.google.cloud.connectors.v1.RoleGrant.encode(message.roleGrant, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.enumOptions != null && message.enumOptions.length) + for (var i = 0; i < message.enumOptions.length; ++i) + $root.google.cloud.connectors.v1.EnumOption.encode(message.enumOptions[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.authorizationCodeLink != null && Object.hasOwnProperty.call(message, "authorizationCodeLink")) + $root.google.cloud.connectors.v1.AuthorizationCodeLink.encode(message.authorizationCodeLink, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.isAdvanced != null && Object.hasOwnProperty.call(message, "isAdvanced")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.isAdvanced); + return writer; + }; + + /** + * Encodes the specified ConfigVariableTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariableTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {google.cloud.connectors.v1.IConfigVariableTemplate} message ConfigVariableTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigVariableTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfigVariableTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ConfigVariableTemplate} ConfigVariableTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigVariableTemplate.decode = function 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.connectors.v1.ConfigVariableTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.valueType = reader.int32(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.validationRegex = reader.string(); + break; + } + case 6: { + message.required = reader.bool(); + break; + } + case 7: { + message.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.enumOptions && message.enumOptions.length)) + message.enumOptions = []; + message.enumOptions.push($root.google.cloud.connectors.v1.EnumOption.decode(reader, reader.uint32())); + break; + } + case 9: { + message.authorizationCodeLink = $root.google.cloud.connectors.v1.AuthorizationCodeLink.decode(reader, reader.uint32()); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.isAdvanced = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfigVariableTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ConfigVariableTemplate} ConfigVariableTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigVariableTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfigVariableTemplate message. + * @function verify + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfigVariableTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.validationRegex != null && message.hasOwnProperty("validationRegex")) + if (!$util.isString(message.validationRegex)) + return "validationRegex: string expected"; + if (message.required != null && message.hasOwnProperty("required")) + if (typeof message.required !== "boolean") + return "required: boolean expected"; + if (message.roleGrant != null && message.hasOwnProperty("roleGrant")) { + var error = $root.google.cloud.connectors.v1.RoleGrant.verify(message.roleGrant); + if (error) + return "roleGrant." + error; + } + if (message.enumOptions != null && message.hasOwnProperty("enumOptions")) { + if (!Array.isArray(message.enumOptions)) + return "enumOptions: array expected"; + for (var i = 0; i < message.enumOptions.length; ++i) { + var error = $root.google.cloud.connectors.v1.EnumOption.verify(message.enumOptions[i]); + if (error) + return "enumOptions." + error; + } + } + if (message.authorizationCodeLink != null && message.hasOwnProperty("authorizationCodeLink")) { + var error = $root.google.cloud.connectors.v1.AuthorizationCodeLink.verify(message.authorizationCodeLink); + if (error) + return "authorizationCodeLink." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.isAdvanced != null && message.hasOwnProperty("isAdvanced")) + if (typeof message.isAdvanced !== "boolean") + return "isAdvanced: boolean expected"; + return null; + }; + + /** + * Creates a ConfigVariableTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ConfigVariableTemplate} ConfigVariableTemplate + */ + ConfigVariableTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ConfigVariableTemplate) + return object; + var message = new $root.google.cloud.connectors.v1.ConfigVariableTemplate(); + if (object.key != null) + message.key = String(object.key); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "STRING": + case 1: + message.valueType = 1; + break; + case "INT": + case 2: + message.valueType = 2; + break; + case "BOOL": + case 3: + message.valueType = 3; + break; + case "SECRET": + case 4: + message.valueType = 4; + break; + case "ENUM": + case 5: + message.valueType = 5; + break; + case "AUTHORIZATION_CODE": + case 6: + message.valueType = 6; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.validationRegex != null) + message.validationRegex = String(object.validationRegex); + if (object.required != null) + message.required = Boolean(object.required); + if (object.roleGrant != null) { + if (typeof object.roleGrant !== "object") + throw TypeError(".google.cloud.connectors.v1.ConfigVariableTemplate.roleGrant: object expected"); + message.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.fromObject(object.roleGrant); + } + if (object.enumOptions) { + if (!Array.isArray(object.enumOptions)) + throw TypeError(".google.cloud.connectors.v1.ConfigVariableTemplate.enumOptions: array expected"); + message.enumOptions = []; + for (var i = 0; i < object.enumOptions.length; ++i) { + if (typeof object.enumOptions[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ConfigVariableTemplate.enumOptions: object expected"); + message.enumOptions[i] = $root.google.cloud.connectors.v1.EnumOption.fromObject(object.enumOptions[i]); + } + } + if (object.authorizationCodeLink != null) { + if (typeof object.authorizationCodeLink !== "object") + throw TypeError(".google.cloud.connectors.v1.ConfigVariableTemplate.authorizationCodeLink: object expected"); + message.authorizationCodeLink = $root.google.cloud.connectors.v1.AuthorizationCodeLink.fromObject(object.authorizationCodeLink); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "DEPRECATED": + case 2: + message.state = 2; + break; + } + if (object.isAdvanced != null) + message.isAdvanced = Boolean(object.isAdvanced); + return message; + }; + + /** + * Creates a plain object from a ConfigVariableTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {google.cloud.connectors.v1.ConfigVariableTemplate} message ConfigVariableTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfigVariableTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.enumOptions = []; + if (options.defaults) { + object.key = ""; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.description = ""; + object.validationRegex = ""; + object.required = false; + object.roleGrant = null; + object.authorizationCodeLink = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.isAdvanced = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.cloud.connectors.v1.ConfigVariableTemplate.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.connectors.v1.ConfigVariableTemplate.ValueType[message.valueType] : message.valueType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.validationRegex != null && message.hasOwnProperty("validationRegex")) + object.validationRegex = message.validationRegex; + if (message.required != null && message.hasOwnProperty("required")) + object.required = message.required; + if (message.roleGrant != null && message.hasOwnProperty("roleGrant")) + object.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.toObject(message.roleGrant, options); + if (message.enumOptions && message.enumOptions.length) { + object.enumOptions = []; + for (var j = 0; j < message.enumOptions.length; ++j) + object.enumOptions[j] = $root.google.cloud.connectors.v1.EnumOption.toObject(message.enumOptions[j], options); + } + if (message.authorizationCodeLink != null && message.hasOwnProperty("authorizationCodeLink")) + object.authorizationCodeLink = $root.google.cloud.connectors.v1.AuthorizationCodeLink.toObject(message.authorizationCodeLink, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.connectors.v1.ConfigVariableTemplate.State[message.state] === undefined ? message.state : $root.google.cloud.connectors.v1.ConfigVariableTemplate.State[message.state] : message.state; + if (message.isAdvanced != null && message.hasOwnProperty("isAdvanced")) + object.isAdvanced = message.isAdvanced; + return object; + }; + + /** + * Converts this ConfigVariableTemplate to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + * @returns {Object.} JSON object + */ + ConfigVariableTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfigVariableTemplate + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfigVariableTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ConfigVariableTemplate"; + }; + + /** + * ValueType enum. + * @name google.cloud.connectors.v1.ConfigVariableTemplate.ValueType + * @enum {number} + * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INT=2 INT value + * @property {number} BOOL=3 BOOL value + * @property {number} SECRET=4 SECRET value + * @property {number} ENUM=5 ENUM value + * @property {number} AUTHORIZATION_CODE=6 AUTHORIZATION_CODE value + */ + ConfigVariableTemplate.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INT"] = 2; + values[valuesById[3] = "BOOL"] = 3; + values[valuesById[4] = "SECRET"] = 4; + values[valuesById[5] = "ENUM"] = 5; + values[valuesById[6] = "AUTHORIZATION_CODE"] = 6; + return values; + })(); + + /** + * State enum. + * @name google.cloud.connectors.v1.ConfigVariableTemplate.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} DEPRECATED=2 DEPRECATED value + */ + ConfigVariableTemplate.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "DEPRECATED"] = 2; + return values; + })(); + + return ConfigVariableTemplate; + })(); + + v1.Secret = (function() { + + /** + * Properties of a Secret. + * @memberof google.cloud.connectors.v1 + * @interface ISecret + * @property {string|null} [secretVersion] Secret secretVersion + */ + + /** + * Constructs a new Secret. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Secret. + * @implements ISecret + * @constructor + * @param {google.cloud.connectors.v1.ISecret=} [properties] Properties to set + */ + function Secret(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]]; + } + + /** + * Secret secretVersion. + * @member {string} secretVersion + * @memberof google.cloud.connectors.v1.Secret + * @instance + */ + Secret.prototype.secretVersion = ""; + + /** + * Creates a new Secret instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {google.cloud.connectors.v1.ISecret=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Secret} Secret instance + */ + Secret.create = function create(properties) { + return new Secret(properties); + }; + + /** + * Encodes the specified Secret message. Does not implicitly {@link google.cloud.connectors.v1.Secret.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {google.cloud.connectors.v1.ISecret} message Secret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Secret.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secretVersion != null && Object.hasOwnProperty.call(message, "secretVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secretVersion); + return writer; + }; + + /** + * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Secret.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {google.cloud.connectors.v1.ISecret} message Secret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Secret.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Secret message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Secret} Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Secret.decode = function 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.connectors.v1.Secret(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.secretVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Secret message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Secret} Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Secret.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Secret message. + * @function verify + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Secret.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secretVersion != null && message.hasOwnProperty("secretVersion")) + if (!$util.isString(message.secretVersion)) + return "secretVersion: string expected"; + return null; + }; + + /** + * Creates a Secret message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Secret} Secret + */ + Secret.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Secret) + return object; + var message = new $root.google.cloud.connectors.v1.Secret(); + if (object.secretVersion != null) + message.secretVersion = String(object.secretVersion); + return message; + }; + + /** + * Creates a plain object from a Secret message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {google.cloud.connectors.v1.Secret} message Secret + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Secret.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.secretVersion = ""; + if (message.secretVersion != null && message.hasOwnProperty("secretVersion")) + object.secretVersion = message.secretVersion; + return object; + }; + + /** + * Converts this Secret to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Secret + * @instance + * @returns {Object.} JSON object + */ + Secret.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Secret + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Secret.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Secret"; + }; + + return Secret; + })(); + + v1.EnumOption = (function() { + + /** + * Properties of an EnumOption. + * @memberof google.cloud.connectors.v1 + * @interface IEnumOption + * @property {string|null} [id] EnumOption id + * @property {string|null} [displayName] EnumOption displayName + */ + + /** + * Constructs a new EnumOption. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an EnumOption. + * @implements IEnumOption + * @constructor + * @param {google.cloud.connectors.v1.IEnumOption=} [properties] Properties to set + */ + function EnumOption(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]]; + } + + /** + * EnumOption id. + * @member {string} id + * @memberof google.cloud.connectors.v1.EnumOption + * @instance + */ + EnumOption.prototype.id = ""; + + /** + * EnumOption displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.EnumOption + * @instance + */ + EnumOption.prototype.displayName = ""; + + /** + * Creates a new EnumOption instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {google.cloud.connectors.v1.IEnumOption=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.EnumOption} EnumOption instance + */ + EnumOption.create = function create(properties) { + return new EnumOption(properties); + }; + + /** + * Encodes the specified EnumOption message. Does not implicitly {@link google.cloud.connectors.v1.EnumOption.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {google.cloud.connectors.v1.IEnumOption} message EnumOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified EnumOption message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.EnumOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {google.cloud.connectors.v1.IEnumOption} message EnumOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.EnumOption} EnumOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOption.decode = function 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.connectors.v1.EnumOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.EnumOption} EnumOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOption message. + * @function verify + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an EnumOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.EnumOption} EnumOption + */ + EnumOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.EnumOption) + return object; + var message = new $root.google.cloud.connectors.v1.EnumOption(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an EnumOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {google.cloud.connectors.v1.EnumOption} message EnumOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this EnumOption to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.EnumOption + * @instance + * @returns {Object.} JSON object + */ + EnumOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOption + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.EnumOption"; + }; + + return EnumOption; + })(); + + v1.ConfigVariable = (function() { + + /** + * Properties of a ConfigVariable. + * @memberof google.cloud.connectors.v1 + * @interface IConfigVariable + * @property {string|null} [key] ConfigVariable key + * @property {number|Long|null} [intValue] ConfigVariable intValue + * @property {boolean|null} [boolValue] ConfigVariable boolValue + * @property {string|null} [stringValue] ConfigVariable stringValue + * @property {google.cloud.connectors.v1.ISecret|null} [secretValue] ConfigVariable secretValue + */ + + /** + * Constructs a new ConfigVariable. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ConfigVariable. + * @implements IConfigVariable + * @constructor + * @param {google.cloud.connectors.v1.IConfigVariable=} [properties] Properties to set + */ + function ConfigVariable(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]]; + } + + /** + * ConfigVariable key. + * @member {string} key + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + ConfigVariable.prototype.key = ""; + + /** + * ConfigVariable intValue. + * @member {number|Long|null|undefined} intValue + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + ConfigVariable.prototype.intValue = null; + + /** + * ConfigVariable boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + ConfigVariable.prototype.boolValue = null; + + /** + * ConfigVariable stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + ConfigVariable.prototype.stringValue = null; + + /** + * ConfigVariable secretValue. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} secretValue + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + ConfigVariable.prototype.secretValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConfigVariable value. + * @member {"intValue"|"boolValue"|"stringValue"|"secretValue"|undefined} value + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + Object.defineProperty(ConfigVariable.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["intValue", "boolValue", "stringValue", "secretValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConfigVariable instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {google.cloud.connectors.v1.IConfigVariable=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ConfigVariable} ConfigVariable instance + */ + ConfigVariable.create = function create(properties) { + return new ConfigVariable(properties); + }; + + /** + * Encodes the specified ConfigVariable message. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariable.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {google.cloud.connectors.v1.IConfigVariable} message ConfigVariable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigVariable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.intValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.boolValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.stringValue); + if (message.secretValue != null && Object.hasOwnProperty.call(message, "secretValue")) + $root.google.cloud.connectors.v1.Secret.encode(message.secretValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConfigVariable message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {google.cloud.connectors.v1.IConfigVariable} message ConfigVariable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigVariable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfigVariable message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ConfigVariable} ConfigVariable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigVariable.decode = function 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.connectors.v1.ConfigVariable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.intValue = reader.int64(); + break; + } + case 3: { + message.boolValue = reader.bool(); + break; + } + case 4: { + message.stringValue = reader.string(); + break; + } + case 5: { + message.secretValue = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfigVariable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ConfigVariable} ConfigVariable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigVariable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfigVariable message. + * @function verify + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfigVariable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.intValue != null && message.hasOwnProperty("intValue")) { + properties.value = 1; + if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) + return "intValue: integer|Long expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.secretValue != null && message.hasOwnProperty("secretValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.secretValue); + if (error) + return "secretValue." + error; + } + } + return null; + }; + + /** + * Creates a ConfigVariable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ConfigVariable} ConfigVariable + */ + ConfigVariable.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ConfigVariable) + return object; + var message = new $root.google.cloud.connectors.v1.ConfigVariable(); + if (object.key != null) + message.key = String(object.key); + if (object.intValue != null) + if ($util.Long) + (message.intValue = $util.Long.fromValue(object.intValue)).unsigned = false; + else if (typeof object.intValue === "string") + message.intValue = parseInt(object.intValue, 10); + else if (typeof object.intValue === "number") + message.intValue = object.intValue; + else if (typeof object.intValue === "object") + message.intValue = new $util.LongBits(object.intValue.low >>> 0, object.intValue.high >>> 0).toNumber(); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.secretValue != null) { + if (typeof object.secretValue !== "object") + throw TypeError(".google.cloud.connectors.v1.ConfigVariable.secretValue: object expected"); + message.secretValue = $root.google.cloud.connectors.v1.Secret.fromObject(object.secretValue); + } + return message; + }; + + /** + * Creates a plain object from a ConfigVariable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {google.cloud.connectors.v1.ConfigVariable} message ConfigVariable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfigVariable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.key = ""; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (typeof message.intValue === "number") + object.intValue = options.longs === String ? String(message.intValue) : message.intValue; + else + object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; + if (options.oneofs) + object.value = "intValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.value = "boolValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.value = "stringValue"; + } + if (message.secretValue != null && message.hasOwnProperty("secretValue")) { + object.secretValue = $root.google.cloud.connectors.v1.Secret.toObject(message.secretValue, options); + if (options.oneofs) + object.value = "secretValue"; + } + return object; + }; + + /** + * Converts this ConfigVariable to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + * @returns {Object.} JSON object + */ + ConfigVariable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfigVariable + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfigVariable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ConfigVariable"; + }; + + return ConfigVariable; + })(); + + v1.RoleGrant = (function() { + + /** + * Properties of a RoleGrant. + * @memberof google.cloud.connectors.v1 + * @interface IRoleGrant + * @property {google.cloud.connectors.v1.RoleGrant.Principal|null} [principal] RoleGrant principal + * @property {Array.|null} [roles] RoleGrant roles + * @property {google.cloud.connectors.v1.RoleGrant.IResource|null} [resource] RoleGrant resource + * @property {string|null} [helperTextTemplate] RoleGrant helperTextTemplate + */ + + /** + * Constructs a new RoleGrant. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a RoleGrant. + * @implements IRoleGrant + * @constructor + * @param {google.cloud.connectors.v1.IRoleGrant=} [properties] Properties to set + */ + function RoleGrant(properties) { + this.roles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoleGrant principal. + * @member {google.cloud.connectors.v1.RoleGrant.Principal} principal + * @memberof google.cloud.connectors.v1.RoleGrant + * @instance + */ + RoleGrant.prototype.principal = 0; + + /** + * RoleGrant roles. + * @member {Array.} roles + * @memberof google.cloud.connectors.v1.RoleGrant + * @instance + */ + RoleGrant.prototype.roles = $util.emptyArray; + + /** + * RoleGrant resource. + * @member {google.cloud.connectors.v1.RoleGrant.IResource|null|undefined} resource + * @memberof google.cloud.connectors.v1.RoleGrant + * @instance + */ + RoleGrant.prototype.resource = null; + + /** + * RoleGrant helperTextTemplate. + * @member {string} helperTextTemplate + * @memberof google.cloud.connectors.v1.RoleGrant + * @instance + */ + RoleGrant.prototype.helperTextTemplate = ""; + + /** + * Creates a new RoleGrant instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {google.cloud.connectors.v1.IRoleGrant=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RoleGrant} RoleGrant instance + */ + RoleGrant.create = function create(properties) { + return new RoleGrant(properties); + }; + + /** + * Encodes the specified RoleGrant message. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {google.cloud.connectors.v1.IRoleGrant} message RoleGrant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoleGrant.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.principal != null && Object.hasOwnProperty.call(message, "principal")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.principal); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.roles[i]); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.connectors.v1.RoleGrant.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.helperTextTemplate != null && Object.hasOwnProperty.call(message, "helperTextTemplate")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.helperTextTemplate); + return writer; + }; + + /** + * Encodes the specified RoleGrant message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {google.cloud.connectors.v1.IRoleGrant} message RoleGrant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoleGrant.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoleGrant message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RoleGrant} RoleGrant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoleGrant.decode = function 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.connectors.v1.RoleGrant(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.principal = reader.int32(); + break; + } + case 2: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push(reader.string()); + break; + } + case 3: { + message.resource = $root.google.cloud.connectors.v1.RoleGrant.Resource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.helperTextTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoleGrant message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RoleGrant} RoleGrant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoleGrant.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoleGrant message. + * @function verify + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoleGrant.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.principal != null && message.hasOwnProperty("principal")) + switch (message.principal) { + default: + return "principal: enum value expected"; + case 0: + case 1: + break; + } + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) + if (!$util.isString(message.roles[i])) + return "roles: string[] expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.connectors.v1.RoleGrant.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.helperTextTemplate != null && message.hasOwnProperty("helperTextTemplate")) + if (!$util.isString(message.helperTextTemplate)) + return "helperTextTemplate: string expected"; + return null; + }; + + /** + * Creates a RoleGrant message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RoleGrant} RoleGrant + */ + RoleGrant.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RoleGrant) + return object; + var message = new $root.google.cloud.connectors.v1.RoleGrant(); + switch (object.principal) { + default: + if (typeof object.principal === "number") { + message.principal = object.principal; + break; + } + break; + case "PRINCIPAL_UNSPECIFIED": + case 0: + message.principal = 0; + break; + case "CONNECTOR_SA": + case 1: + message.principal = 1; + break; + } + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.connectors.v1.RoleGrant.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) + message.roles[i] = String(object.roles[i]); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.connectors.v1.RoleGrant.resource: object expected"); + message.resource = $root.google.cloud.connectors.v1.RoleGrant.Resource.fromObject(object.resource); + } + if (object.helperTextTemplate != null) + message.helperTextTemplate = String(object.helperTextTemplate); + return message; + }; + + /** + * Creates a plain object from a RoleGrant message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {google.cloud.connectors.v1.RoleGrant} message RoleGrant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoleGrant.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.roles = []; + if (options.defaults) { + object.principal = options.enums === String ? "PRINCIPAL_UNSPECIFIED" : 0; + object.resource = null; + object.helperTextTemplate = ""; + } + if (message.principal != null && message.hasOwnProperty("principal")) + object.principal = options.enums === String ? $root.google.cloud.connectors.v1.RoleGrant.Principal[message.principal] === undefined ? message.principal : $root.google.cloud.connectors.v1.RoleGrant.Principal[message.principal] : message.principal; + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = message.roles[j]; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.connectors.v1.RoleGrant.Resource.toObject(message.resource, options); + if (message.helperTextTemplate != null && message.hasOwnProperty("helperTextTemplate")) + object.helperTextTemplate = message.helperTextTemplate; + return object; + }; + + /** + * Converts this RoleGrant to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RoleGrant + * @instance + * @returns {Object.} JSON object + */ + RoleGrant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoleGrant + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoleGrant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RoleGrant"; + }; + + /** + * Principal enum. + * @name google.cloud.connectors.v1.RoleGrant.Principal + * @enum {number} + * @property {number} PRINCIPAL_UNSPECIFIED=0 PRINCIPAL_UNSPECIFIED value + * @property {number} CONNECTOR_SA=1 CONNECTOR_SA value + */ + RoleGrant.Principal = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRINCIPAL_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONNECTOR_SA"] = 1; + return values; + })(); + + RoleGrant.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.connectors.v1.RoleGrant + * @interface IResource + * @property {google.cloud.connectors.v1.RoleGrant.Resource.Type|null} [type] Resource type + * @property {string|null} [pathTemplate] Resource pathTemplate + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.connectors.v1.RoleGrant + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.connectors.v1.RoleGrant.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource type. + * @member {google.cloud.connectors.v1.RoleGrant.Resource.Type} type + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @instance + */ + Resource.prototype.type = 0; + + /** + * Resource pathTemplate. + * @member {string} pathTemplate + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @instance + */ + Resource.prototype.pathTemplate = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {google.cloud.connectors.v1.RoleGrant.IResource=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RoleGrant.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {google.cloud.connectors.v1.RoleGrant.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pathTemplate); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {google.cloud.connectors.v1.RoleGrant.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RoleGrant.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decode = function 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.connectors.v1.RoleGrant.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 3: { + message.pathTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RoleGrant.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + if (!$util.isString(message.pathTemplate)) + return "pathTemplate: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RoleGrant.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RoleGrant.Resource) + return object; + var message = new $root.google.cloud.connectors.v1.RoleGrant.Resource(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "GCP_PROJECT": + case 1: + message.type = 1; + break; + case "GCP_RESOURCE": + case 2: + message.type = 2; + break; + case "GCP_SECRETMANAGER_SECRET": + case 3: + message.type = 3; + break; + case "GCP_SECRETMANAGER_SECRET_VERSION": + case 4: + message.type = 4; + break; + } + if (object.pathTemplate != null) + message.pathTemplate = String(object.pathTemplate); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {google.cloud.connectors.v1.RoleGrant.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.pathTemplate = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.connectors.v1.RoleGrant.Resource.Type[message.type] === undefined ? message.type : $root.google.cloud.connectors.v1.RoleGrant.Resource.Type[message.type] : message.type; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + object.pathTemplate = message.pathTemplate; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RoleGrant.Resource"; + }; + + /** + * Type enum. + * @name google.cloud.connectors.v1.RoleGrant.Resource.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} GCP_PROJECT=1 GCP_PROJECT value + * @property {number} GCP_RESOURCE=2 GCP_RESOURCE value + * @property {number} GCP_SECRETMANAGER_SECRET=3 GCP_SECRETMANAGER_SECRET value + * @property {number} GCP_SECRETMANAGER_SECRET_VERSION=4 GCP_SECRETMANAGER_SECRET_VERSION value + */ + Resource.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GCP_PROJECT"] = 1; + values[valuesById[2] = "GCP_RESOURCE"] = 2; + values[valuesById[3] = "GCP_SECRETMANAGER_SECRET"] = 3; + values[valuesById[4] = "GCP_SECRETMANAGER_SECRET_VERSION"] = 4; + return values; + })(); + + return Resource; + })(); + + return RoleGrant; + })(); + + v1.AuthorizationCodeLink = (function() { + + /** + * Properties of an AuthorizationCodeLink. + * @memberof google.cloud.connectors.v1 + * @interface IAuthorizationCodeLink + * @property {string|null} [uri] AuthorizationCodeLink uri + * @property {Array.|null} [scopes] AuthorizationCodeLink scopes + * @property {string|null} [clientId] AuthorizationCodeLink clientId + * @property {boolean|null} [enablePkce] AuthorizationCodeLink enablePkce + */ + + /** + * Constructs a new AuthorizationCodeLink. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an AuthorizationCodeLink. + * @implements IAuthorizationCodeLink + * @constructor + * @param {google.cloud.connectors.v1.IAuthorizationCodeLink=} [properties] Properties to set + */ + function AuthorizationCodeLink(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthorizationCodeLink uri. + * @member {string} uri + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @instance + */ + AuthorizationCodeLink.prototype.uri = ""; + + /** + * AuthorizationCodeLink scopes. + * @member {Array.} scopes + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @instance + */ + AuthorizationCodeLink.prototype.scopes = $util.emptyArray; + + /** + * AuthorizationCodeLink clientId. + * @member {string} clientId + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @instance + */ + AuthorizationCodeLink.prototype.clientId = ""; + + /** + * AuthorizationCodeLink enablePkce. + * @member {boolean} enablePkce + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @instance + */ + AuthorizationCodeLink.prototype.enablePkce = false; + + /** + * Creates a new AuthorizationCodeLink instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {google.cloud.connectors.v1.IAuthorizationCodeLink=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthorizationCodeLink} AuthorizationCodeLink instance + */ + AuthorizationCodeLink.create = function create(properties) { + return new AuthorizationCodeLink(properties); + }; + + /** + * Encodes the specified AuthorizationCodeLink message. Does not implicitly {@link google.cloud.connectors.v1.AuthorizationCodeLink.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {google.cloud.connectors.v1.IAuthorizationCodeLink} message AuthorizationCodeLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizationCodeLink.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientId); + if (message.enablePkce != null && Object.hasOwnProperty.call(message, "enablePkce")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enablePkce); + return writer; + }; + + /** + * Encodes the specified AuthorizationCodeLink message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthorizationCodeLink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {google.cloud.connectors.v1.IAuthorizationCodeLink} message AuthorizationCodeLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizationCodeLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizationCodeLink message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthorizationCodeLink} AuthorizationCodeLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizationCodeLink.decode = function 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.connectors.v1.AuthorizationCodeLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + case 3: { + message.clientId = reader.string(); + break; + } + case 4: { + message.enablePkce = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizationCodeLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthorizationCodeLink} AuthorizationCodeLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizationCodeLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizationCodeLink message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizationCodeLink.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.enablePkce != null && message.hasOwnProperty("enablePkce")) + if (typeof message.enablePkce !== "boolean") + return "enablePkce: boolean expected"; + return null; + }; + + /** + * Creates an AuthorizationCodeLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthorizationCodeLink} AuthorizationCodeLink + */ + AuthorizationCodeLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthorizationCodeLink) + return object; + var message = new $root.google.cloud.connectors.v1.AuthorizationCodeLink(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.connectors.v1.AuthorizationCodeLink.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.enablePkce != null) + message.enablePkce = Boolean(object.enablePkce); + return message; + }; + + /** + * Creates a plain object from an AuthorizationCodeLink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {google.cloud.connectors.v1.AuthorizationCodeLink} message AuthorizationCodeLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizationCodeLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.uri = ""; + object.clientId = ""; + object.enablePkce = false; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.enablePkce != null && message.hasOwnProperty("enablePkce")) + object.enablePkce = message.enablePkce; + return object; + }; + + /** + * Converts this AuthorizationCodeLink to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @instance + * @returns {Object.} JSON object + */ + AuthorizationCodeLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizationCodeLink + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizationCodeLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthorizationCodeLink"; + }; + + return AuthorizationCodeLink; + })(); + + /** + * LaunchStage enum. + * @name google.cloud.connectors.v1.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} PREVIEW=1 PREVIEW value + * @property {number} GA=2 GA value + * @property {number} DEPRECATED=3 DEPRECATED value + * @property {number} PRIVATE_PREVIEW=5 PRIVATE_PREVIEW value + */ + v1.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PREVIEW"] = 1; + values[valuesById[2] = "GA"] = 2; + values[valuesById[3] = "DEPRECATED"] = 3; + values[valuesById[5] = "PRIVATE_PREVIEW"] = 5; + return values; + })(); + + v1.Connection = (function() { + + /** + * Properties of a Connection. + * @memberof google.cloud.connectors.v1 + * @interface IConnection + * @property {string|null} [name] Connection name + * @property {google.protobuf.ITimestamp|null} [createTime] Connection createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Connection updateTime + * @property {Object.|null} [labels] Connection labels + * @property {string|null} [description] Connection description + * @property {string|null} [connectorVersion] Connection connectorVersion + * @property {google.cloud.connectors.v1.IConnectionStatus|null} [status] Connection status + * @property {Array.|null} [configVariables] Connection configVariables + * @property {google.cloud.connectors.v1.IAuthConfig|null} [authConfig] Connection authConfig + * @property {google.cloud.connectors.v1.ILockConfig|null} [lockConfig] Connection lockConfig + * @property {Array.|null} [destinationConfigs] Connection destinationConfigs + * @property {string|null} [imageLocation] Connection imageLocation + * @property {string|null} [serviceAccount] Connection serviceAccount + * @property {string|null} [serviceDirectory] Connection serviceDirectory + * @property {string|null} [envoyImageLocation] Connection envoyImageLocation + * @property {boolean|null} [suspended] Connection suspended + * @property {google.cloud.connectors.v1.INodeConfig|null} [nodeConfig] Connection nodeConfig + * @property {google.cloud.connectors.v1.ISslConfig|null} [sslConfig] Connection sslConfig + */ + + /** + * Constructs a new Connection. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Connection. + * @implements IConnection + * @constructor + * @param {google.cloud.connectors.v1.IConnection=} [properties] Properties to set + */ + function Connection(properties) { + this.labels = {}; + this.configVariables = []; + this.destinationConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Connection name. + * @member {string} name + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.name = ""; + + /** + * Connection createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.createTime = null; + + /** + * Connection updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.updateTime = null; + + /** + * Connection labels. + * @member {Object.} labels + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.labels = $util.emptyObject; + + /** + * Connection description. + * @member {string} description + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.description = ""; + + /** + * Connection connectorVersion. + * @member {string} connectorVersion + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.connectorVersion = ""; + + /** + * Connection status. + * @member {google.cloud.connectors.v1.IConnectionStatus|null|undefined} status + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.status = null; + + /** + * Connection configVariables. + * @member {Array.} configVariables + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.configVariables = $util.emptyArray; + + /** + * Connection authConfig. + * @member {google.cloud.connectors.v1.IAuthConfig|null|undefined} authConfig + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.authConfig = null; + + /** + * Connection lockConfig. + * @member {google.cloud.connectors.v1.ILockConfig|null|undefined} lockConfig + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.lockConfig = null; + + /** + * Connection destinationConfigs. + * @member {Array.} destinationConfigs + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.destinationConfigs = $util.emptyArray; + + /** + * Connection imageLocation. + * @member {string} imageLocation + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.imageLocation = ""; + + /** + * Connection serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.serviceAccount = ""; + + /** + * Connection serviceDirectory. + * @member {string} serviceDirectory + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.serviceDirectory = ""; + + /** + * Connection envoyImageLocation. + * @member {string} envoyImageLocation + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.envoyImageLocation = ""; + + /** + * Connection suspended. + * @member {boolean} suspended + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.suspended = false; + + /** + * Connection nodeConfig. + * @member {google.cloud.connectors.v1.INodeConfig|null|undefined} nodeConfig + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.nodeConfig = null; + + /** + * Connection sslConfig. + * @member {google.cloud.connectors.v1.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.sslConfig = null; + + /** + * Creates a new Connection instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {google.cloud.connectors.v1.IConnection=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Connection} Connection instance + */ + Connection.create = function create(properties) { + return new Connection(properties); + }; + + /** + * Encodes the specified Connection message. Does not implicitly {@link google.cloud.connectors.v1.Connection.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {google.cloud.connectors.v1.IConnection} message Connection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.connectorVersion != null && Object.hasOwnProperty.call(message, "connectorVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.connectorVersion); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.connectors.v1.ConnectionStatus.encode(message.status, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.configVariables != null && message.configVariables.length) + for (var i = 0; i < message.configVariables.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariable.encode(message.configVariables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) + $root.google.cloud.connectors.v1.AuthConfig.encode(message.authConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.lockConfig != null && Object.hasOwnProperty.call(message, "lockConfig")) + $root.google.cloud.connectors.v1.LockConfig.encode(message.lockConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.imageLocation != null && Object.hasOwnProperty.call(message, "imageLocation")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.imageLocation); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.serviceAccount); + if (message.serviceDirectory != null && Object.hasOwnProperty.call(message, "serviceDirectory")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.serviceDirectory); + if (message.envoyImageLocation != null && Object.hasOwnProperty.call(message, "envoyImageLocation")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.envoyImageLocation); + if (message.suspended != null && Object.hasOwnProperty.call(message, "suspended")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.suspended); + if (message.destinationConfigs != null && message.destinationConfigs.length) + for (var i = 0; i < message.destinationConfigs.length; ++i) + $root.google.cloud.connectors.v1.DestinationConfig.encode(message.destinationConfigs[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) + $root.google.cloud.connectors.v1.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.connectors.v1.SslConfig.encode(message.sslConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Connection message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Connection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {google.cloud.connectors.v1.IConnection} message Connection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Connection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Connection} Connection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connection.decode = function 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.connectors.v1.Connection(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.connectorVersion = reader.string(); + break; + } + case 7: { + message.status = $root.google.cloud.connectors.v1.ConnectionStatus.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.configVariables && message.configVariables.length)) + message.configVariables = []; + message.configVariables.push($root.google.cloud.connectors.v1.ConfigVariable.decode(reader, reader.uint32())); + break; + } + case 9: { + message.authConfig = $root.google.cloud.connectors.v1.AuthConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.lockConfig = $root.google.cloud.connectors.v1.LockConfig.decode(reader, reader.uint32()); + break; + } + case 18: { + if (!(message.destinationConfigs && message.destinationConfigs.length)) + message.destinationConfigs = []; + message.destinationConfigs.push($root.google.cloud.connectors.v1.DestinationConfig.decode(reader, reader.uint32())); + break; + } + case 11: { + message.imageLocation = reader.string(); + break; + } + case 12: { + message.serviceAccount = reader.string(); + break; + } + case 13: { + message.serviceDirectory = reader.string(); + break; + } + case 15: { + message.envoyImageLocation = reader.string(); + break; + } + case 17: { + message.suspended = reader.bool(); + break; + } + case 19: { + message.nodeConfig = $root.google.cloud.connectors.v1.NodeConfig.decode(reader, reader.uint32()); + break; + } + case 21: { + message.sslConfig = $root.google.cloud.connectors.v1.SslConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Connection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Connection} Connection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Connection message. + * @function verify + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Connection.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.connectorVersion != null && message.hasOwnProperty("connectorVersion")) + if (!$util.isString(message.connectorVersion)) + return "connectorVersion: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.connectors.v1.ConnectionStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.configVariables != null && message.hasOwnProperty("configVariables")) { + if (!Array.isArray(message.configVariables)) + return "configVariables: array expected"; + for (var i = 0; i < message.configVariables.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariable.verify(message.configVariables[i]); + if (error) + return "configVariables." + error; + } + } + if (message.authConfig != null && message.hasOwnProperty("authConfig")) { + var error = $root.google.cloud.connectors.v1.AuthConfig.verify(message.authConfig); + if (error) + return "authConfig." + error; + } + if (message.lockConfig != null && message.hasOwnProperty("lockConfig")) { + var error = $root.google.cloud.connectors.v1.LockConfig.verify(message.lockConfig); + if (error) + return "lockConfig." + error; + } + if (message.destinationConfigs != null && message.hasOwnProperty("destinationConfigs")) { + if (!Array.isArray(message.destinationConfigs)) + return "destinationConfigs: array expected"; + for (var i = 0; i < message.destinationConfigs.length; ++i) { + var error = $root.google.cloud.connectors.v1.DestinationConfig.verify(message.destinationConfigs[i]); + if (error) + return "destinationConfigs." + error; + } + } + if (message.imageLocation != null && message.hasOwnProperty("imageLocation")) + if (!$util.isString(message.imageLocation)) + return "imageLocation: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) + if (!$util.isString(message.serviceDirectory)) + return "serviceDirectory: string expected"; + if (message.envoyImageLocation != null && message.hasOwnProperty("envoyImageLocation")) + if (!$util.isString(message.envoyImageLocation)) + return "envoyImageLocation: string expected"; + if (message.suspended != null && message.hasOwnProperty("suspended")) + if (typeof message.suspended !== "boolean") + return "suspended: boolean expected"; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { + var error = $root.google.cloud.connectors.v1.NodeConfig.verify(message.nodeConfig); + if (error) + return "nodeConfig." + error; + } + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.connectors.v1.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + return null; + }; + + /** + * Creates a Connection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Connection} Connection + */ + Connection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Connection) + return object; + var message = new $root.google.cloud.connectors.v1.Connection(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + if (object.connectorVersion != null) + message.connectorVersion = String(object.connectorVersion); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.status: object expected"); + message.status = $root.google.cloud.connectors.v1.ConnectionStatus.fromObject(object.status); + } + if (object.configVariables) { + if (!Array.isArray(object.configVariables)) + throw TypeError(".google.cloud.connectors.v1.Connection.configVariables: array expected"); + message.configVariables = []; + for (var i = 0; i < object.configVariables.length; ++i) { + if (typeof object.configVariables[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.configVariables: object expected"); + message.configVariables[i] = $root.google.cloud.connectors.v1.ConfigVariable.fromObject(object.configVariables[i]); + } + } + if (object.authConfig != null) { + if (typeof object.authConfig !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.authConfig: object expected"); + message.authConfig = $root.google.cloud.connectors.v1.AuthConfig.fromObject(object.authConfig); + } + if (object.lockConfig != null) { + if (typeof object.lockConfig !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.lockConfig: object expected"); + message.lockConfig = $root.google.cloud.connectors.v1.LockConfig.fromObject(object.lockConfig); + } + if (object.destinationConfigs) { + if (!Array.isArray(object.destinationConfigs)) + throw TypeError(".google.cloud.connectors.v1.Connection.destinationConfigs: array expected"); + message.destinationConfigs = []; + for (var i = 0; i < object.destinationConfigs.length; ++i) { + if (typeof object.destinationConfigs[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.destinationConfigs: object expected"); + message.destinationConfigs[i] = $root.google.cloud.connectors.v1.DestinationConfig.fromObject(object.destinationConfigs[i]); + } + } + if (object.imageLocation != null) + message.imageLocation = String(object.imageLocation); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.serviceDirectory != null) + message.serviceDirectory = String(object.serviceDirectory); + if (object.envoyImageLocation != null) + message.envoyImageLocation = String(object.envoyImageLocation); + if (object.suspended != null) + message.suspended = Boolean(object.suspended); + if (object.nodeConfig != null) { + if (typeof object.nodeConfig !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.nodeConfig: object expected"); + message.nodeConfig = $root.google.cloud.connectors.v1.NodeConfig.fromObject(object.nodeConfig); + } + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.connectors.v1.SslConfig.fromObject(object.sslConfig); + } + return message; + }; + + /** + * Creates a plain object from a Connection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {google.cloud.connectors.v1.Connection} message Connection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Connection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.configVariables = []; + object.destinationConfigs = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.connectorVersion = ""; + object.status = null; + object.authConfig = null; + object.lockConfig = null; + object.imageLocation = ""; + object.serviceAccount = ""; + object.serviceDirectory = ""; + object.envoyImageLocation = ""; + object.suspended = false; + object.nodeConfig = null; + object.sslConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.connectorVersion != null && message.hasOwnProperty("connectorVersion")) + object.connectorVersion = message.connectorVersion; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.connectors.v1.ConnectionStatus.toObject(message.status, options); + if (message.configVariables && message.configVariables.length) { + object.configVariables = []; + for (var j = 0; j < message.configVariables.length; ++j) + object.configVariables[j] = $root.google.cloud.connectors.v1.ConfigVariable.toObject(message.configVariables[j], options); + } + if (message.authConfig != null && message.hasOwnProperty("authConfig")) + object.authConfig = $root.google.cloud.connectors.v1.AuthConfig.toObject(message.authConfig, options); + if (message.lockConfig != null && message.hasOwnProperty("lockConfig")) + object.lockConfig = $root.google.cloud.connectors.v1.LockConfig.toObject(message.lockConfig, options); + if (message.imageLocation != null && message.hasOwnProperty("imageLocation")) + object.imageLocation = message.imageLocation; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) + object.serviceDirectory = message.serviceDirectory; + if (message.envoyImageLocation != null && message.hasOwnProperty("envoyImageLocation")) + object.envoyImageLocation = message.envoyImageLocation; + if (message.suspended != null && message.hasOwnProperty("suspended")) + object.suspended = message.suspended; + if (message.destinationConfigs && message.destinationConfigs.length) { + object.destinationConfigs = []; + for (var j = 0; j < message.destinationConfigs.length; ++j) + object.destinationConfigs[j] = $root.google.cloud.connectors.v1.DestinationConfig.toObject(message.destinationConfigs[j], options); + } + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + object.nodeConfig = $root.google.cloud.connectors.v1.NodeConfig.toObject(message.nodeConfig, options); + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.connectors.v1.SslConfig.toObject(message.sslConfig, options); + return object; + }; + + /** + * Converts this Connection to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Connection + * @instance + * @returns {Object.} JSON object + */ + Connection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Connection + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Connection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Connection"; + }; + + return Connection; + })(); + + v1.NodeConfig = (function() { + + /** + * Properties of a NodeConfig. + * @memberof google.cloud.connectors.v1 + * @interface INodeConfig + * @property {number|null} [minNodeCount] NodeConfig minNodeCount + * @property {number|null} [maxNodeCount] NodeConfig maxNodeCount + */ + + /** + * Constructs a new NodeConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a NodeConfig. + * @implements INodeConfig + * @constructor + * @param {google.cloud.connectors.v1.INodeConfig=} [properties] Properties to set + */ + function NodeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeConfig minNodeCount. + * @member {number} minNodeCount + * @memberof google.cloud.connectors.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.minNodeCount = 0; + + /** + * NodeConfig maxNodeCount. + * @member {number} maxNodeCount + * @memberof google.cloud.connectors.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.maxNodeCount = 0; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {google.cloud.connectors.v1.INodeConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.NodeConfig} NodeConfig instance + */ + NodeConfig.create = function create(properties) { + return new NodeConfig(properties); + }; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.connectors.v1.NodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {google.cloud.connectors.v1.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minNodeCount != null && Object.hasOwnProperty.call(message, "minNodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minNodeCount); + if (message.maxNodeCount != null && Object.hasOwnProperty.call(message, "maxNodeCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxNodeCount); + return writer; + }; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.NodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {google.cloud.connectors.v1.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.NodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.minNodeCount = reader.int32(); + break; + } + case 2: { + message.maxNodeCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) + if (!$util.isInteger(message.minNodeCount)) + return "minNodeCount: integer expected"; + if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) + if (!$util.isInteger(message.maxNodeCount)) + return "maxNodeCount: integer expected"; + return null; + }; + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.NodeConfig} NodeConfig + */ + NodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.NodeConfig) + return object; + var message = new $root.google.cloud.connectors.v1.NodeConfig(); + if (object.minNodeCount != null) + message.minNodeCount = object.minNodeCount | 0; + if (object.maxNodeCount != null) + message.maxNodeCount = object.maxNodeCount | 0; + return message; + }; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {google.cloud.connectors.v1.NodeConfig} message NodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minNodeCount = 0; + object.maxNodeCount = 0; + } + if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) + object.minNodeCount = message.minNodeCount; + if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) + object.maxNodeCount = message.maxNodeCount; + return object; + }; + + /** + * Converts this NodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.NodeConfig + * @instance + * @returns {Object.} JSON object + */ + NodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.NodeConfig"; + }; + + return NodeConfig; + })(); + + v1.ConnectionSchemaMetadata = (function() { + + /** + * Properties of a ConnectionSchemaMetadata. + * @memberof google.cloud.connectors.v1 + * @interface IConnectionSchemaMetadata + * @property {Array.|null} [entities] ConnectionSchemaMetadata entities + * @property {Array.|null} [actions] ConnectionSchemaMetadata actions + * @property {string|null} [name] ConnectionSchemaMetadata name + * @property {google.protobuf.ITimestamp|null} [updateTime] ConnectionSchemaMetadata updateTime + * @property {google.protobuf.ITimestamp|null} [refreshTime] ConnectionSchemaMetadata refreshTime + * @property {google.cloud.connectors.v1.ConnectionSchemaMetadata.State|null} [state] ConnectionSchemaMetadata state + */ + + /** + * Constructs a new ConnectionSchemaMetadata. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ConnectionSchemaMetadata. + * @implements IConnectionSchemaMetadata + * @constructor + * @param {google.cloud.connectors.v1.IConnectionSchemaMetadata=} [properties] Properties to set + */ + function ConnectionSchemaMetadata(properties) { + this.entities = []; + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionSchemaMetadata entities. + * @member {Array.} entities + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.entities = $util.emptyArray; + + /** + * ConnectionSchemaMetadata actions. + * @member {Array.} actions + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.actions = $util.emptyArray; + + /** + * ConnectionSchemaMetadata name. + * @member {string} name + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.name = ""; + + /** + * ConnectionSchemaMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.updateTime = null; + + /** + * ConnectionSchemaMetadata refreshTime. + * @member {google.protobuf.ITimestamp|null|undefined} refreshTime + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.refreshTime = null; + + /** + * ConnectionSchemaMetadata state. + * @member {google.cloud.connectors.v1.ConnectionSchemaMetadata.State} state + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.state = 0; + + /** + * Creates a new ConnectionSchemaMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {google.cloud.connectors.v1.IConnectionSchemaMetadata=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ConnectionSchemaMetadata} ConnectionSchemaMetadata instance + */ + ConnectionSchemaMetadata.create = function create(properties) { + return new ConnectionSchemaMetadata(properties); + }; + + /** + * Encodes the specified ConnectionSchemaMetadata message. Does not implicitly {@link google.cloud.connectors.v1.ConnectionSchemaMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {google.cloud.connectors.v1.IConnectionSchemaMetadata} message ConnectionSchemaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionSchemaMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entities[i]); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.actions[i]); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.refreshTime != null && Object.hasOwnProperty.call(message, "refreshTime")) + $root.google.protobuf.Timestamp.encode(message.refreshTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + return writer; + }; + + /** + * Encodes the specified ConnectionSchemaMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectionSchemaMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {google.cloud.connectors.v1.IConnectionSchemaMetadata} message ConnectionSchemaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionSchemaMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionSchemaMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ConnectionSchemaMetadata} ConnectionSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionSchemaMetadata.decode = function 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.connectors.v1.ConnectionSchemaMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push(reader.string()); + break; + } + case 2: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push(reader.string()); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.refreshTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionSchemaMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ConnectionSchemaMetadata} ConnectionSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionSchemaMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionSchemaMetadata message. + * @function verify + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionSchemaMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) + if (!$util.isString(message.entities[i])) + return "entities: string[] expected"; + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) + if (!$util.isString(message.actions[i])) + return "actions: string[] expected"; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.refreshTime != null && message.hasOwnProperty("refreshTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.refreshTime); + if (error) + return "refreshTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ConnectionSchemaMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ConnectionSchemaMetadata} ConnectionSchemaMetadata + */ + ConnectionSchemaMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ConnectionSchemaMetadata) + return object; + var message = new $root.google.cloud.connectors.v1.ConnectionSchemaMetadata(); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.connectors.v1.ConnectionSchemaMetadata.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) + message.entities[i] = String(object.entities[i]); + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.cloud.connectors.v1.ConnectionSchemaMetadata.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) + message.actions[i] = String(object.actions[i]); + } + if (object.name != null) + message.name = String(object.name); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectionSchemaMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.refreshTime != null) { + if (typeof object.refreshTime !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectionSchemaMetadata.refreshTime: object expected"); + message.refreshTime = $root.google.protobuf.Timestamp.fromObject(object.refreshTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "REFRESHING": + case 1: + message.state = 1; + break; + case "UPDATED": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ConnectionSchemaMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {google.cloud.connectors.v1.ConnectionSchemaMetadata} message ConnectionSchemaMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionSchemaMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.entities = []; + object.actions = []; + } + if (options.defaults) { + object.name = ""; + object.updateTime = null; + object.refreshTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = message.entities[j]; + } + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = message.actions[j]; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.refreshTime != null && message.hasOwnProperty("refreshTime")) + object.refreshTime = $root.google.protobuf.Timestamp.toObject(message.refreshTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.connectors.v1.ConnectionSchemaMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.connectors.v1.ConnectionSchemaMetadata.State[message.state] : message.state; + return object; + }; + + /** + * Converts this ConnectionSchemaMetadata to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + * @returns {Object.} JSON object + */ + ConnectionSchemaMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionSchemaMetadata + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionSchemaMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ConnectionSchemaMetadata"; + }; + + /** + * State enum. + * @name google.cloud.connectors.v1.ConnectionSchemaMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} REFRESHING=1 REFRESHING value + * @property {number} UPDATED=2 UPDATED value + */ + ConnectionSchemaMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REFRESHING"] = 1; + values[valuesById[2] = "UPDATED"] = 2; + return values; + })(); + + return ConnectionSchemaMetadata; + })(); + + v1.RuntimeEntitySchema = (function() { + + /** + * Properties of a RuntimeEntitySchema. + * @memberof google.cloud.connectors.v1 + * @interface IRuntimeEntitySchema + * @property {string|null} [entity] RuntimeEntitySchema entity + * @property {Array.|null} [fields] RuntimeEntitySchema fields + */ + + /** + * Constructs a new RuntimeEntitySchema. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a RuntimeEntitySchema. + * @implements IRuntimeEntitySchema + * @constructor + * @param {google.cloud.connectors.v1.IRuntimeEntitySchema=} [properties] Properties to set + */ + function RuntimeEntitySchema(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuntimeEntitySchema entity. + * @member {string} entity + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @instance + */ + RuntimeEntitySchema.prototype.entity = ""; + + /** + * RuntimeEntitySchema fields. + * @member {Array.} fields + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @instance + */ + RuntimeEntitySchema.prototype.fields = $util.emptyArray; + + /** + * Creates a new RuntimeEntitySchema instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeEntitySchema=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema} RuntimeEntitySchema instance + */ + RuntimeEntitySchema.create = function create(properties) { + return new RuntimeEntitySchema(properties); + }; + + /** + * Encodes the specified RuntimeEntitySchema message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeEntitySchema} message RuntimeEntitySchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeEntitySchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entity); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field.encode(message.fields[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuntimeEntitySchema message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeEntitySchema} message RuntimeEntitySchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeEntitySchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeEntitySchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema} RuntimeEntitySchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeEntitySchema.decode = function 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.connectors.v1.RuntimeEntitySchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = reader.string(); + break; + } + case 2: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.connectors.v1.RuntimeEntitySchema.Field.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeEntitySchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema} RuntimeEntitySchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeEntitySchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeEntitySchema message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeEntitySchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: string expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a RuntimeEntitySchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema} RuntimeEntitySchema + */ + RuntimeEntitySchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeEntitySchema) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeEntitySchema(); + if (object.entity != null) + message.entity = String(object.entity); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.connectors.v1.RuntimeEntitySchema.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeEntitySchema.fields: object expected"); + message.fields[i] = $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field.fromObject(object.fields[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RuntimeEntitySchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {google.cloud.connectors.v1.RuntimeEntitySchema} message RuntimeEntitySchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeEntitySchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) + object.entity = ""; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field.toObject(message.fields[j], options); + } + return object; + }; + + /** + * Converts this RuntimeEntitySchema to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @instance + * @returns {Object.} JSON object + */ + RuntimeEntitySchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeEntitySchema + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeEntitySchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeEntitySchema"; + }; + + RuntimeEntitySchema.Field = (function() { + + /** + * Properties of a Field. + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @interface IField + * @property {string|null} [field] Field field + * @property {string|null} [description] Field description + * @property {google.cloud.connectors.v1.DataType|null} [dataType] Field dataType + * @property {boolean|null} [key] Field key + * @property {boolean|null} [readonly] Field readonly + * @property {boolean|null} [nullable] Field nullable + * @property {google.protobuf.IValue|null} [defaultValue] Field defaultValue + * @property {google.protobuf.IStruct|null} [additionalDetails] Field additionalDetails + */ + + /** + * Constructs a new Field. + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @classdesc Represents a Field. + * @implements IField + * @constructor + * @param {google.cloud.connectors.v1.RuntimeEntitySchema.IField=} [properties] Properties to set + */ + function Field(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]]; + } + + /** + * Field field. + * @member {string} field + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.field = ""; + + /** + * Field description. + * @member {string} description + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.description = ""; + + /** + * Field dataType. + * @member {google.cloud.connectors.v1.DataType} dataType + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.dataType = 0; + + /** + * Field key. + * @member {boolean} key + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.key = false; + + /** + * Field readonly. + * @member {boolean} readonly + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.readonly = false; + + /** + * Field nullable. + * @member {boolean} nullable + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.nullable = false; + + /** + * Field defaultValue. + * @member {google.protobuf.IValue|null|undefined} defaultValue + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.defaultValue = null; + + /** + * Field additionalDetails. + * @member {google.protobuf.IStruct|null|undefined} additionalDetails + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.additionalDetails = null; + + /** + * Creates a new Field instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {google.cloud.connectors.v1.RuntimeEntitySchema.IField=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema.Field} Field instance + */ + Field.create = function create(properties) { + return new Field(properties); + }; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.Field.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {google.cloud.connectors.v1.RuntimeEntitySchema.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataType); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.key); + if (message.readonly != null && Object.hasOwnProperty.call(message, "readonly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.readonly); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.nullable); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + $root.google.protobuf.Value.encode(message.defaultValue, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.additionalDetails != null && Object.hasOwnProperty.call(message, "additionalDetails")) + $root.google.protobuf.Struct.encode(message.additionalDetails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.Field.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {google.cloud.connectors.v1.RuntimeEntitySchema.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Field message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decode = function 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.connectors.v1.RuntimeEntitySchema.Field(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.dataType = reader.int32(); + break; + } + case 4: { + message.key = reader.bool(); + break; + } + case 5: { + message.readonly = reader.bool(); + break; + } + case 6: { + message.nullable = reader.bool(); + break; + } + case 7: { + message.defaultValue = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 8: { + message.additionalDetails = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Field message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Field.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + break; + } + if (message.key != null && message.hasOwnProperty("key")) + if (typeof message.key !== "boolean") + return "key: boolean expected"; + if (message.readonly != null && message.hasOwnProperty("readonly")) + if (typeof message.readonly !== "boolean") + return "readonly: boolean expected"; + if (message.nullable != null && message.hasOwnProperty("nullable")) + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) { + var error = $root.google.protobuf.Value.verify(message.defaultValue); + if (error) + return "defaultValue." + error; + } + if (message.additionalDetails != null && message.hasOwnProperty("additionalDetails")) { + var error = $root.google.protobuf.Struct.verify(message.additionalDetails); + if (error) + return "additionalDetails." + error; + } + return null; + }; + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema.Field} Field + */ + Field.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field(); + if (object.field != null) + message.field = String(object.field); + if (object.description != null) + message.description = String(object.description); + switch (object.dataType) { + default: + if (typeof object.dataType === "number") { + message.dataType = object.dataType; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.dataType = 0; + break; + case "DATA_TYPE_INT": + case 1: + message.dataType = 1; + break; + case "DATA_TYPE_SMALLINT": + case 2: + message.dataType = 2; + break; + case "DATA_TYPE_DOUBLE": + case 3: + message.dataType = 3; + break; + case "DATA_TYPE_DATE": + case 4: + message.dataType = 4; + break; + case "DATA_TYPE_DATETIME": + case 5: + message.dataType = 5; + break; + case "DATA_TYPE_TIME": + case 6: + message.dataType = 6; + break; + case "DATA_TYPE_STRING": + case 7: + message.dataType = 7; + break; + case "DATA_TYPE_LONG": + case 8: + message.dataType = 8; + break; + case "DATA_TYPE_BOOLEAN": + case 9: + message.dataType = 9; + break; + case "DATA_TYPE_DECIMAL": + case 10: + message.dataType = 10; + break; + case "DATA_TYPE_UUID": + case 11: + message.dataType = 11; + break; + case "DATA_TYPE_BLOB": + case 12: + message.dataType = 12; + break; + case "DATA_TYPE_BIT": + case 13: + message.dataType = 13; + break; + case "DATA_TYPE_TINYINT": + case 14: + message.dataType = 14; + break; + case "DATA_TYPE_INTEGER": + case 15: + message.dataType = 15; + break; + case "DATA_TYPE_BIGINT": + case 16: + message.dataType = 16; + break; + case "DATA_TYPE_FLOAT": + case 17: + message.dataType = 17; + break; + case "DATA_TYPE_REAL": + case 18: + message.dataType = 18; + break; + case "DATA_TYPE_NUMERIC": + case 19: + message.dataType = 19; + break; + case "DATA_TYPE_CHAR": + case 20: + message.dataType = 20; + break; + case "DATA_TYPE_VARCHAR": + case 21: + message.dataType = 21; + break; + case "DATA_TYPE_LONGVARCHAR": + case 22: + message.dataType = 22; + break; + case "DATA_TYPE_TIMESTAMP": + case 23: + message.dataType = 23; + break; + case "DATA_TYPE_NCHAR": + case 24: + message.dataType = 24; + break; + case "DATA_TYPE_NVARCHAR": + case 25: + message.dataType = 25; + break; + case "DATA_TYPE_LONGNVARCHAR": + case 26: + message.dataType = 26; + break; + case "DATA_TYPE_NULL": + case 27: + message.dataType = 27; + break; + case "DATA_TYPE_OTHER": + case 28: + message.dataType = 28; + break; + case "DATA_TYPE_JAVA_OBJECT": + case 29: + message.dataType = 29; + break; + case "DATA_TYPE_DISTINCT": + case 30: + message.dataType = 30; + break; + case "DATA_TYPE_STRUCT": + case 31: + message.dataType = 31; + break; + case "DATA_TYPE_ARRAY": + case 32: + message.dataType = 32; + break; + case "DATA_TYPE_CLOB": + case 33: + message.dataType = 33; + break; + case "DATA_TYPE_REF": + case 34: + message.dataType = 34; + break; + case "DATA_TYPE_DATALINK": + case 35: + message.dataType = 35; + break; + case "DATA_TYPE_ROWID": + case 36: + message.dataType = 36; + break; + case "DATA_TYPE_BINARY": + case 37: + message.dataType = 37; + break; + case "DATA_TYPE_VARBINARY": + case 38: + message.dataType = 38; + break; + case "DATA_TYPE_LONGVARBINARY": + case 39: + message.dataType = 39; + break; + case "DATA_TYPE_NCLOB": + case 40: + message.dataType = 40; + break; + case "DATA_TYPE_SQLXML": + case 41: + message.dataType = 41; + break; + case "DATA_TYPE_REF_CURSOR": + case 42: + message.dataType = 42; + break; + case "DATA_TYPE_TIME_WITH_TIMEZONE": + case 43: + message.dataType = 43; + break; + case "DATA_TYPE_TIMESTAMP_WITH_TIMEZONE": + case 44: + message.dataType = 44; + break; + } + if (object.key != null) + message.key = Boolean(object.key); + if (object.readonly != null) + message.readonly = Boolean(object.readonly); + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + if (object.defaultValue != null) { + if (typeof object.defaultValue !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeEntitySchema.Field.defaultValue: object expected"); + message.defaultValue = $root.google.protobuf.Value.fromObject(object.defaultValue); + } + if (object.additionalDetails != null) { + if (typeof object.additionalDetails !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeEntitySchema.Field.additionalDetails: object expected"); + message.additionalDetails = $root.google.protobuf.Struct.fromObject(object.additionalDetails); + } + return message; + }; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {google.cloud.connectors.v1.RuntimeEntitySchema.Field} message Field + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Field.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.description = ""; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.key = false; + object.readonly = false; + object.nullable = false; + object.defaultValue = null; + object.additionalDetails = null; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.connectors.v1.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.connectors.v1.DataType[message.dataType] : message.dataType; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.readonly != null && message.hasOwnProperty("readonly")) + object.readonly = message.readonly; + if (message.nullable != null && message.hasOwnProperty("nullable")) + object.nullable = message.nullable; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = $root.google.protobuf.Value.toObject(message.defaultValue, options); + if (message.additionalDetails != null && message.hasOwnProperty("additionalDetails")) + object.additionalDetails = $root.google.protobuf.Struct.toObject(message.additionalDetails, options); + return object; + }; + + /** + * Converts this Field to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + * @returns {Object.} JSON object + */ + Field.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Field + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeEntitySchema.Field"; + }; + + return Field; + })(); + + return RuntimeEntitySchema; + })(); + + v1.RuntimeActionSchema = (function() { + + /** + * Properties of a RuntimeActionSchema. + * @memberof google.cloud.connectors.v1 + * @interface IRuntimeActionSchema + * @property {string|null} [action] RuntimeActionSchema action + * @property {Array.|null} [inputParameters] RuntimeActionSchema inputParameters + * @property {Array.|null} [resultMetadata] RuntimeActionSchema resultMetadata + */ + + /** + * Constructs a new RuntimeActionSchema. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a RuntimeActionSchema. + * @implements IRuntimeActionSchema + * @constructor + * @param {google.cloud.connectors.v1.IRuntimeActionSchema=} [properties] Properties to set + */ + function RuntimeActionSchema(properties) { + this.inputParameters = []; + this.resultMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuntimeActionSchema action. + * @member {string} action + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @instance + */ + RuntimeActionSchema.prototype.action = ""; + + /** + * RuntimeActionSchema inputParameters. + * @member {Array.} inputParameters + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @instance + */ + RuntimeActionSchema.prototype.inputParameters = $util.emptyArray; + + /** + * RuntimeActionSchema resultMetadata. + * @member {Array.} resultMetadata + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @instance + */ + RuntimeActionSchema.prototype.resultMetadata = $util.emptyArray; + + /** + * Creates a new RuntimeActionSchema instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeActionSchema=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeActionSchema} RuntimeActionSchema instance + */ + RuntimeActionSchema.create = function create(properties) { + return new RuntimeActionSchema(properties); + }; + + /** + * Encodes the specified RuntimeActionSchema message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeActionSchema} message RuntimeActionSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeActionSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.action); + if (message.inputParameters != null && message.inputParameters.length) + for (var i = 0; i < message.inputParameters.length; ++i) + $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.encode(message.inputParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resultMetadata != null && message.resultMetadata.length) + for (var i = 0; i < message.resultMetadata.length; ++i) + $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.encode(message.resultMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuntimeActionSchema message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeActionSchema} message RuntimeActionSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeActionSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeActionSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeActionSchema} RuntimeActionSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeActionSchema.decode = function 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.connectors.v1.RuntimeActionSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.string(); + break; + } + case 2: { + if (!(message.inputParameters && message.inputParameters.length)) + message.inputParameters = []; + message.inputParameters.push($root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.resultMetadata && message.resultMetadata.length)) + message.resultMetadata = []; + message.resultMetadata.push($root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeActionSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeActionSchema} RuntimeActionSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeActionSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeActionSchema message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeActionSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) { + if (!Array.isArray(message.inputParameters)) + return "inputParameters: array expected"; + for (var i = 0; i < message.inputParameters.length; ++i) { + var error = $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.verify(message.inputParameters[i]); + if (error) + return "inputParameters." + error; + } + } + if (message.resultMetadata != null && message.hasOwnProperty("resultMetadata")) { + if (!Array.isArray(message.resultMetadata)) + return "resultMetadata: array expected"; + for (var i = 0; i < message.resultMetadata.length; ++i) { + var error = $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.verify(message.resultMetadata[i]); + if (error) + return "resultMetadata." + error; + } + } + return null; + }; + + /** + * Creates a RuntimeActionSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeActionSchema} RuntimeActionSchema + */ + RuntimeActionSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeActionSchema) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeActionSchema(); + if (object.action != null) + message.action = String(object.action); + if (object.inputParameters) { + if (!Array.isArray(object.inputParameters)) + throw TypeError(".google.cloud.connectors.v1.RuntimeActionSchema.inputParameters: array expected"); + message.inputParameters = []; + for (var i = 0; i < object.inputParameters.length; ++i) { + if (typeof object.inputParameters[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeActionSchema.inputParameters: object expected"); + message.inputParameters[i] = $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.fromObject(object.inputParameters[i]); + } + } + if (object.resultMetadata) { + if (!Array.isArray(object.resultMetadata)) + throw TypeError(".google.cloud.connectors.v1.RuntimeActionSchema.resultMetadata: array expected"); + message.resultMetadata = []; + for (var i = 0; i < object.resultMetadata.length; ++i) { + if (typeof object.resultMetadata[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeActionSchema.resultMetadata: object expected"); + message.resultMetadata[i] = $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.fromObject(object.resultMetadata[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RuntimeActionSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema} message RuntimeActionSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeActionSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputParameters = []; + object.resultMetadata = []; + } + if (options.defaults) + object.action = ""; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.inputParameters && message.inputParameters.length) { + object.inputParameters = []; + for (var j = 0; j < message.inputParameters.length; ++j) + object.inputParameters[j] = $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.toObject(message.inputParameters[j], options); + } + if (message.resultMetadata && message.resultMetadata.length) { + object.resultMetadata = []; + for (var j = 0; j < message.resultMetadata.length; ++j) + object.resultMetadata[j] = $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.toObject(message.resultMetadata[j], options); + } + return object; + }; + + /** + * Converts this RuntimeActionSchema to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @instance + * @returns {Object.} JSON object + */ + RuntimeActionSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeActionSchema + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeActionSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeActionSchema"; + }; + + RuntimeActionSchema.InputParameter = (function() { + + /** + * Properties of an InputParameter. + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @interface IInputParameter + * @property {string|null} [parameter] InputParameter parameter + * @property {string|null} [description] InputParameter description + * @property {google.cloud.connectors.v1.DataType|null} [dataType] InputParameter dataType + * @property {boolean|null} [nullable] InputParameter nullable + * @property {google.protobuf.IValue|null} [defaultValue] InputParameter defaultValue + */ + + /** + * Constructs a new InputParameter. + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @classdesc Represents an InputParameter. + * @implements IInputParameter + * @constructor + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter=} [properties] Properties to set + */ + function InputParameter(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]]; + } + + /** + * InputParameter parameter. + * @member {string} parameter + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + */ + InputParameter.prototype.parameter = ""; + + /** + * InputParameter description. + * @member {string} description + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + */ + InputParameter.prototype.description = ""; + + /** + * InputParameter dataType. + * @member {google.cloud.connectors.v1.DataType} dataType + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + */ + InputParameter.prototype.dataType = 0; + + /** + * InputParameter nullable. + * @member {boolean} nullable + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + */ + InputParameter.prototype.nullable = false; + + /** + * InputParameter defaultValue. + * @member {google.protobuf.IValue|null|undefined} defaultValue + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + */ + InputParameter.prototype.defaultValue = null; + + /** + * Creates a new InputParameter instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.InputParameter} InputParameter instance + */ + InputParameter.create = function create(properties) { + return new InputParameter(properties); + }; + + /** + * Encodes the specified InputParameter message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter} message InputParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameter != null && Object.hasOwnProperty.call(message, "parameter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parameter); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataType); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.nullable); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + $root.google.protobuf.Value.encode(message.defaultValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputParameter message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter} message InputParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputParameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.InputParameter} InputParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputParameter.decode = function 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.connectors.v1.RuntimeActionSchema.InputParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parameter = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.dataType = reader.int32(); + break; + } + case 4: { + message.nullable = reader.bool(); + break; + } + case 5: { + message.defaultValue = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.InputParameter} InputParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputParameter message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parameter != null && message.hasOwnProperty("parameter")) + if (!$util.isString(message.parameter)) + return "parameter: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + break; + } + if (message.nullable != null && message.hasOwnProperty("nullable")) + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) { + var error = $root.google.protobuf.Value.verify(message.defaultValue); + if (error) + return "defaultValue." + error; + } + return null; + }; + + /** + * Creates an InputParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.InputParameter} InputParameter + */ + InputParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter(); + if (object.parameter != null) + message.parameter = String(object.parameter); + if (object.description != null) + message.description = String(object.description); + switch (object.dataType) { + default: + if (typeof object.dataType === "number") { + message.dataType = object.dataType; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.dataType = 0; + break; + case "DATA_TYPE_INT": + case 1: + message.dataType = 1; + break; + case "DATA_TYPE_SMALLINT": + case 2: + message.dataType = 2; + break; + case "DATA_TYPE_DOUBLE": + case 3: + message.dataType = 3; + break; + case "DATA_TYPE_DATE": + case 4: + message.dataType = 4; + break; + case "DATA_TYPE_DATETIME": + case 5: + message.dataType = 5; + break; + case "DATA_TYPE_TIME": + case 6: + message.dataType = 6; + break; + case "DATA_TYPE_STRING": + case 7: + message.dataType = 7; + break; + case "DATA_TYPE_LONG": + case 8: + message.dataType = 8; + break; + case "DATA_TYPE_BOOLEAN": + case 9: + message.dataType = 9; + break; + case "DATA_TYPE_DECIMAL": + case 10: + message.dataType = 10; + break; + case "DATA_TYPE_UUID": + case 11: + message.dataType = 11; + break; + case "DATA_TYPE_BLOB": + case 12: + message.dataType = 12; + break; + case "DATA_TYPE_BIT": + case 13: + message.dataType = 13; + break; + case "DATA_TYPE_TINYINT": + case 14: + message.dataType = 14; + break; + case "DATA_TYPE_INTEGER": + case 15: + message.dataType = 15; + break; + case "DATA_TYPE_BIGINT": + case 16: + message.dataType = 16; + break; + case "DATA_TYPE_FLOAT": + case 17: + message.dataType = 17; + break; + case "DATA_TYPE_REAL": + case 18: + message.dataType = 18; + break; + case "DATA_TYPE_NUMERIC": + case 19: + message.dataType = 19; + break; + case "DATA_TYPE_CHAR": + case 20: + message.dataType = 20; + break; + case "DATA_TYPE_VARCHAR": + case 21: + message.dataType = 21; + break; + case "DATA_TYPE_LONGVARCHAR": + case 22: + message.dataType = 22; + break; + case "DATA_TYPE_TIMESTAMP": + case 23: + message.dataType = 23; + break; + case "DATA_TYPE_NCHAR": + case 24: + message.dataType = 24; + break; + case "DATA_TYPE_NVARCHAR": + case 25: + message.dataType = 25; + break; + case "DATA_TYPE_LONGNVARCHAR": + case 26: + message.dataType = 26; + break; + case "DATA_TYPE_NULL": + case 27: + message.dataType = 27; + break; + case "DATA_TYPE_OTHER": + case 28: + message.dataType = 28; + break; + case "DATA_TYPE_JAVA_OBJECT": + case 29: + message.dataType = 29; + break; + case "DATA_TYPE_DISTINCT": + case 30: + message.dataType = 30; + break; + case "DATA_TYPE_STRUCT": + case 31: + message.dataType = 31; + break; + case "DATA_TYPE_ARRAY": + case 32: + message.dataType = 32; + break; + case "DATA_TYPE_CLOB": + case 33: + message.dataType = 33; + break; + case "DATA_TYPE_REF": + case 34: + message.dataType = 34; + break; + case "DATA_TYPE_DATALINK": + case 35: + message.dataType = 35; + break; + case "DATA_TYPE_ROWID": + case 36: + message.dataType = 36; + break; + case "DATA_TYPE_BINARY": + case 37: + message.dataType = 37; + break; + case "DATA_TYPE_VARBINARY": + case 38: + message.dataType = 38; + break; + case "DATA_TYPE_LONGVARBINARY": + case 39: + message.dataType = 39; + break; + case "DATA_TYPE_NCLOB": + case 40: + message.dataType = 40; + break; + case "DATA_TYPE_SQLXML": + case 41: + message.dataType = 41; + break; + case "DATA_TYPE_REF_CURSOR": + case 42: + message.dataType = 42; + break; + case "DATA_TYPE_TIME_WITH_TIMEZONE": + case 43: + message.dataType = 43; + break; + case "DATA_TYPE_TIMESTAMP_WITH_TIMEZONE": + case 44: + message.dataType = 44; + break; + } + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + if (object.defaultValue != null) { + if (typeof object.defaultValue !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.defaultValue: object expected"); + message.defaultValue = $root.google.protobuf.Value.fromObject(object.defaultValue); + } + return message; + }; + + /** + * Creates a plain object from an InputParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.InputParameter} message InputParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parameter = ""; + object.description = ""; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.nullable = false; + object.defaultValue = null; + } + if (message.parameter != null && message.hasOwnProperty("parameter")) + object.parameter = message.parameter; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.connectors.v1.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.connectors.v1.DataType[message.dataType] : message.dataType; + if (message.nullable != null && message.hasOwnProperty("nullable")) + object.nullable = message.nullable; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = $root.google.protobuf.Value.toObject(message.defaultValue, options); + return object; + }; + + /** + * Converts this InputParameter to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + * @returns {Object.} JSON object + */ + InputParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputParameter + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeActionSchema.InputParameter"; + }; + + return InputParameter; + })(); + + RuntimeActionSchema.ResultMetadata = (function() { + + /** + * Properties of a ResultMetadata. + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @interface IResultMetadata + * @property {string|null} [field] ResultMetadata field + * @property {string|null} [description] ResultMetadata description + * @property {google.cloud.connectors.v1.DataType|null} [dataType] ResultMetadata dataType + */ + + /** + * Constructs a new ResultMetadata. + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @classdesc Represents a ResultMetadata. + * @implements IResultMetadata + * @constructor + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata=} [properties] Properties to set + */ + function ResultMetadata(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]]; + } + + /** + * ResultMetadata field. + * @member {string} field + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @instance + */ + ResultMetadata.prototype.field = ""; + + /** + * ResultMetadata description. + * @member {string} description + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @instance + */ + ResultMetadata.prototype.description = ""; + + /** + * ResultMetadata dataType. + * @member {google.cloud.connectors.v1.DataType} dataType + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @instance + */ + ResultMetadata.prototype.dataType = 0; + + /** + * Creates a new ResultMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata} ResultMetadata instance + */ + ResultMetadata.create = function create(properties) { + return new ResultMetadata(properties); + }; + + /** + * Encodes the specified ResultMetadata message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata} message ResultMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataType); + return writer; + }; + + /** + * Encodes the specified ResultMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata} message ResultMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata} ResultMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultMetadata.decode = function 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.connectors.v1.RuntimeActionSchema.ResultMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.dataType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata} ResultMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultMetadata message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + break; + } + return null; + }; + + /** + * Creates a ResultMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata} ResultMetadata + */ + ResultMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata(); + if (object.field != null) + message.field = String(object.field); + if (object.description != null) + message.description = String(object.description); + switch (object.dataType) { + default: + if (typeof object.dataType === "number") { + message.dataType = object.dataType; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.dataType = 0; + break; + case "DATA_TYPE_INT": + case 1: + message.dataType = 1; + break; + case "DATA_TYPE_SMALLINT": + case 2: + message.dataType = 2; + break; + case "DATA_TYPE_DOUBLE": + case 3: + message.dataType = 3; + break; + case "DATA_TYPE_DATE": + case 4: + message.dataType = 4; + break; + case "DATA_TYPE_DATETIME": + case 5: + message.dataType = 5; + break; + case "DATA_TYPE_TIME": + case 6: + message.dataType = 6; + break; + case "DATA_TYPE_STRING": + case 7: + message.dataType = 7; + break; + case "DATA_TYPE_LONG": + case 8: + message.dataType = 8; + break; + case "DATA_TYPE_BOOLEAN": + case 9: + message.dataType = 9; + break; + case "DATA_TYPE_DECIMAL": + case 10: + message.dataType = 10; + break; + case "DATA_TYPE_UUID": + case 11: + message.dataType = 11; + break; + case "DATA_TYPE_BLOB": + case 12: + message.dataType = 12; + break; + case "DATA_TYPE_BIT": + case 13: + message.dataType = 13; + break; + case "DATA_TYPE_TINYINT": + case 14: + message.dataType = 14; + break; + case "DATA_TYPE_INTEGER": + case 15: + message.dataType = 15; + break; + case "DATA_TYPE_BIGINT": + case 16: + message.dataType = 16; + break; + case "DATA_TYPE_FLOAT": + case 17: + message.dataType = 17; + break; + case "DATA_TYPE_REAL": + case 18: + message.dataType = 18; + break; + case "DATA_TYPE_NUMERIC": + case 19: + message.dataType = 19; + break; + case "DATA_TYPE_CHAR": + case 20: + message.dataType = 20; + break; + case "DATA_TYPE_VARCHAR": + case 21: + message.dataType = 21; + break; + case "DATA_TYPE_LONGVARCHAR": + case 22: + message.dataType = 22; + break; + case "DATA_TYPE_TIMESTAMP": + case 23: + message.dataType = 23; + break; + case "DATA_TYPE_NCHAR": + case 24: + message.dataType = 24; + break; + case "DATA_TYPE_NVARCHAR": + case 25: + message.dataType = 25; + break; + case "DATA_TYPE_LONGNVARCHAR": + case 26: + message.dataType = 26; + break; + case "DATA_TYPE_NULL": + case 27: + message.dataType = 27; + break; + case "DATA_TYPE_OTHER": + case 28: + message.dataType = 28; + break; + case "DATA_TYPE_JAVA_OBJECT": + case 29: + message.dataType = 29; + break; + case "DATA_TYPE_DISTINCT": + case 30: + message.dataType = 30; + break; + case "DATA_TYPE_STRUCT": + case 31: + message.dataType = 31; + break; + case "DATA_TYPE_ARRAY": + case 32: + message.dataType = 32; + break; + case "DATA_TYPE_CLOB": + case 33: + message.dataType = 33; + break; + case "DATA_TYPE_REF": + case 34: + message.dataType = 34; + break; + case "DATA_TYPE_DATALINK": + case 35: + message.dataType = 35; + break; + case "DATA_TYPE_ROWID": + case 36: + message.dataType = 36; + break; + case "DATA_TYPE_BINARY": + case 37: + message.dataType = 37; + break; + case "DATA_TYPE_VARBINARY": + case 38: + message.dataType = 38; + break; + case "DATA_TYPE_LONGVARBINARY": + case 39: + message.dataType = 39; + break; + case "DATA_TYPE_NCLOB": + case 40: + message.dataType = 40; + break; + case "DATA_TYPE_SQLXML": + case 41: + message.dataType = 41; + break; + case "DATA_TYPE_REF_CURSOR": + case 42: + message.dataType = 42; + break; + case "DATA_TYPE_TIME_WITH_TIMEZONE": + case 43: + message.dataType = 43; + break; + case "DATA_TYPE_TIMESTAMP_WITH_TIMEZONE": + case 44: + message.dataType = 44; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResultMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata} message ResultMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.description = ""; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.connectors.v1.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.connectors.v1.DataType[message.dataType] : message.dataType; + return object; + }; + + /** + * Converts this ResultMetadata to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @instance + * @returns {Object.} JSON object + */ + ResultMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultMetadata + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata"; + }; + + return ResultMetadata; + })(); + + return RuntimeActionSchema; + })(); + + v1.LockConfig = (function() { + + /** + * Properties of a LockConfig. + * @memberof google.cloud.connectors.v1 + * @interface ILockConfig + * @property {boolean|null} [locked] LockConfig locked + * @property {string|null} [reason] LockConfig reason + */ + + /** + * Constructs a new LockConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a LockConfig. + * @implements ILockConfig + * @constructor + * @param {google.cloud.connectors.v1.ILockConfig=} [properties] Properties to set + */ + function LockConfig(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]]; + } + + /** + * LockConfig locked. + * @member {boolean} locked + * @memberof google.cloud.connectors.v1.LockConfig + * @instance + */ + LockConfig.prototype.locked = false; + + /** + * LockConfig reason. + * @member {string} reason + * @memberof google.cloud.connectors.v1.LockConfig + * @instance + */ + LockConfig.prototype.reason = ""; + + /** + * Creates a new LockConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {google.cloud.connectors.v1.ILockConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.LockConfig} LockConfig instance + */ + LockConfig.create = function create(properties) { + return new LockConfig(properties); + }; + + /** + * Encodes the specified LockConfig message. Does not implicitly {@link google.cloud.connectors.v1.LockConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {google.cloud.connectors.v1.ILockConfig} message LockConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.locked); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + return writer; + }; + + /** + * Encodes the specified LockConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.LockConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {google.cloud.connectors.v1.ILockConfig} message LockConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LockConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.LockConfig} LockConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockConfig.decode = function 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.connectors.v1.LockConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.locked = reader.bool(); + break; + } + case 2: { + message.reason = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LockConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.LockConfig} LockConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LockConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LockConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locked != null && message.hasOwnProperty("locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + return null; + }; + + /** + * Creates a LockConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.LockConfig} LockConfig + */ + LockConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.LockConfig) + return object; + var message = new $root.google.cloud.connectors.v1.LockConfig(); + if (object.locked != null) + message.locked = Boolean(object.locked); + if (object.reason != null) + message.reason = String(object.reason); + return message; + }; + + /** + * Creates a plain object from a LockConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {google.cloud.connectors.v1.LockConfig} message LockConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LockConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.locked = false; + object.reason = ""; + } + if (message.locked != null && message.hasOwnProperty("locked")) + object.locked = message.locked; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + return object; + }; + + /** + * Converts this LockConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.LockConfig + * @instance + * @returns {Object.} JSON object + */ + LockConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LockConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LockConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.LockConfig"; + }; + + return LockConfig; + })(); + + v1.ListConnectionsRequest = (function() { + + /** + * Properties of a ListConnectionsRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectionsRequest + * @property {string|null} [parent] ListConnectionsRequest parent + * @property {number|null} [pageSize] ListConnectionsRequest pageSize + * @property {string|null} [pageToken] ListConnectionsRequest pageToken + * @property {string|null} [filter] ListConnectionsRequest filter + * @property {string|null} [orderBy] ListConnectionsRequest orderBy + * @property {google.cloud.connectors.v1.ConnectionView|null} [view] ListConnectionsRequest view + */ + + /** + * Constructs a new ListConnectionsRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectionsRequest. + * @implements IListConnectionsRequest + * @constructor + * @param {google.cloud.connectors.v1.IListConnectionsRequest=} [properties] Properties to set + */ + function ListConnectionsRequest(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]]; + } + + /** + * ListConnectionsRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.parent = ""; + + /** + * ListConnectionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.pageSize = 0; + + /** + * ListConnectionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.pageToken = ""; + + /** + * ListConnectionsRequest filter. + * @member {string} filter + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.filter = ""; + + /** + * ListConnectionsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.orderBy = ""; + + /** + * ListConnectionsRequest view. + * @member {google.cloud.connectors.v1.ConnectionView} view + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.view = 0; + + /** + * Creates a new ListConnectionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectionsRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectionsRequest} ListConnectionsRequest instance + */ + ListConnectionsRequest.create = function create(properties) { + return new ListConnectionsRequest(properties); + }; + + /** + * Encodes the specified ListConnectionsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectionsRequest} message ListConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListConnectionsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectionsRequest} message ListConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectionsRequest} ListConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionsRequest.decode = function 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.connectors.v1.ListConnectionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectionsRequest} ListConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectionsRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListConnectionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectionsRequest} ListConnectionsRequest + */ + ListConnectionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectionsRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CONNECTION_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListConnectionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {google.cloud.connectors.v1.ListConnectionsRequest} message ListConnectionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "CONNECTION_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.connectors.v1.ConnectionView[message.view] === undefined ? message.view : $root.google.cloud.connectors.v1.ConnectionView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListConnectionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListConnectionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectionsRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectionsRequest"; + }; + + return ListConnectionsRequest; + })(); + + v1.ListConnectionsResponse = (function() { + + /** + * Properties of a ListConnectionsResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectionsResponse + * @property {Array.|null} [connections] ListConnectionsResponse connections + * @property {string|null} [nextPageToken] ListConnectionsResponse nextPageToken + * @property {Array.|null} [unreachable] ListConnectionsResponse unreachable + */ + + /** + * Constructs a new ListConnectionsResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectionsResponse. + * @implements IListConnectionsResponse + * @constructor + * @param {google.cloud.connectors.v1.IListConnectionsResponse=} [properties] Properties to set + */ + function ListConnectionsResponse(properties) { + this.connections = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConnectionsResponse connections. + * @member {Array.} connections + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @instance + */ + ListConnectionsResponse.prototype.connections = $util.emptyArray; + + /** + * ListConnectionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @instance + */ + ListConnectionsResponse.prototype.nextPageToken = ""; + + /** + * ListConnectionsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @instance + */ + ListConnectionsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListConnectionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectionsResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectionsResponse} ListConnectionsResponse instance + */ + ListConnectionsResponse.create = function create(properties) { + return new ListConnectionsResponse(properties); + }; + + /** + * Encodes the specified ListConnectionsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectionsResponse} message ListConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connections != null && message.connections.length) + for (var i = 0; i < message.connections.length; ++i) + $root.google.cloud.connectors.v1.Connection.encode(message.connections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListConnectionsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectionsResponse} message ListConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectionsResponse} ListConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionsResponse.decode = function 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.connectors.v1.ListConnectionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.connections && message.connections.length)) + message.connections = []; + message.connections.push($root.google.cloud.connectors.v1.Connection.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectionsResponse} ListConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectionsResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connections != null && message.hasOwnProperty("connections")) { + if (!Array.isArray(message.connections)) + return "connections: array expected"; + for (var i = 0; i < message.connections.length; ++i) { + var error = $root.google.cloud.connectors.v1.Connection.verify(message.connections[i]); + if (error) + return "connections." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListConnectionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectionsResponse} ListConnectionsResponse + */ + ListConnectionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectionsResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectionsResponse(); + if (object.connections) { + if (!Array.isArray(object.connections)) + throw TypeError(".google.cloud.connectors.v1.ListConnectionsResponse.connections: array expected"); + message.connections = []; + for (var i = 0; i < object.connections.length; ++i) { + if (typeof object.connections[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListConnectionsResponse.connections: object expected"); + message.connections[i] = $root.google.cloud.connectors.v1.Connection.fromObject(object.connections[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.connectors.v1.ListConnectionsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListConnectionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {google.cloud.connectors.v1.ListConnectionsResponse} message ListConnectionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.connections = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.connections && message.connections.length) { + object.connections = []; + for (var j = 0; j < message.connections.length; ++j) + object.connections[j] = $root.google.cloud.connectors.v1.Connection.toObject(message.connections[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListConnectionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListConnectionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectionsResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectionsResponse"; + }; + + return ListConnectionsResponse; + })(); + + v1.GetConnectionRequest = (function() { + + /** + * Properties of a GetConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetConnectionRequest + * @property {string|null} [name] GetConnectionRequest name + * @property {google.cloud.connectors.v1.ConnectionView|null} [view] GetConnectionRequest view + */ + + /** + * Constructs a new GetConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetConnectionRequest. + * @implements IGetConnectionRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetConnectionRequest=} [properties] Properties to set + */ + function GetConnectionRequest(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]]; + } + + /** + * GetConnectionRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @instance + */ + GetConnectionRequest.prototype.name = ""; + + /** + * GetConnectionRequest view. + * @member {google.cloud.connectors.v1.ConnectionView} view + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @instance + */ + GetConnectionRequest.prototype.view = 0; + + /** + * Creates a new GetConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetConnectionRequest} GetConnectionRequest instance + */ + GetConnectionRequest.create = function create(properties) { + return new GetConnectionRequest(properties); + }; + + /** + * Encodes the specified GetConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionRequest} message GetConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionRequest} message GetConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetConnectionRequest} GetConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionRequest.decode = function 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.connectors.v1.GetConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetConnectionRequest} GetConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectionRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectionRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetConnectionRequest} GetConnectionRequest + */ + GetConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetConnectionRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetConnectionRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CONNECTION_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {google.cloud.connectors.v1.GetConnectionRequest} message GetConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "CONNECTION_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.connectors.v1.ConnectionView[message.view] === undefined ? message.view : $root.google.cloud.connectors.v1.ConnectionView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetConnectionRequest"; + }; + + return GetConnectionRequest; + })(); + + v1.CreateConnectionRequest = (function() { + + /** + * Properties of a CreateConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @interface ICreateConnectionRequest + * @property {string|null} [parent] CreateConnectionRequest parent + * @property {string|null} [connectionId] CreateConnectionRequest connectionId + * @property {google.cloud.connectors.v1.IConnection|null} [connection] CreateConnectionRequest connection + */ + + /** + * Constructs a new CreateConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a CreateConnectionRequest. + * @implements ICreateConnectionRequest + * @constructor + * @param {google.cloud.connectors.v1.ICreateConnectionRequest=} [properties] Properties to set + */ + function CreateConnectionRequest(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]]; + } + + /** + * CreateConnectionRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @instance + */ + CreateConnectionRequest.prototype.parent = ""; + + /** + * CreateConnectionRequest connectionId. + * @member {string} connectionId + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @instance + */ + CreateConnectionRequest.prototype.connectionId = ""; + + /** + * CreateConnectionRequest connection. + * @member {google.cloud.connectors.v1.IConnection|null|undefined} connection + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @instance + */ + CreateConnectionRequest.prototype.connection = null; + + /** + * Creates a new CreateConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.ICreateConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.CreateConnectionRequest} CreateConnectionRequest instance + */ + CreateConnectionRequest.create = function create(properties) { + return new CreateConnectionRequest(properties); + }; + + /** + * Encodes the specified CreateConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.CreateConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.ICreateConnectionRequest} message CreateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateConnectionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.connectionId); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + $root.google.cloud.connectors.v1.Connection.encode(message.connection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.CreateConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.ICreateConnectionRequest} message CreateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.CreateConnectionRequest} CreateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateConnectionRequest.decode = function 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.connectors.v1.CreateConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.connectionId = reader.string(); + break; + } + case 3: { + message.connection = $root.google.cloud.connectors.v1.Connection.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.CreateConnectionRequest} CreateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateConnectionRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateConnectionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.connection != null && message.hasOwnProperty("connection")) { + var error = $root.google.cloud.connectors.v1.Connection.verify(message.connection); + if (error) + return "connection." + error; + } + return null; + }; + + /** + * Creates a CreateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.CreateConnectionRequest} CreateConnectionRequest + */ + CreateConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.CreateConnectionRequest) + return object; + var message = new $root.google.cloud.connectors.v1.CreateConnectionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.connection != null) { + if (typeof object.connection !== "object") + throw TypeError(".google.cloud.connectors.v1.CreateConnectionRequest.connection: object expected"); + message.connection = $root.google.cloud.connectors.v1.Connection.fromObject(object.connection); + } + return message; + }; + + /** + * Creates a plain object from a CreateConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.CreateConnectionRequest} message CreateConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.connectionId = ""; + object.connection = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = $root.google.cloud.connectors.v1.Connection.toObject(message.connection, options); + return object; + }; + + /** + * Converts this CreateConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.CreateConnectionRequest"; + }; + + return CreateConnectionRequest; + })(); + + v1.UpdateConnectionRequest = (function() { + + /** + * Properties of an UpdateConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @interface IUpdateConnectionRequest + * @property {google.cloud.connectors.v1.IConnection|null} [connection] UpdateConnectionRequest connection + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateConnectionRequest updateMask + */ + + /** + * Constructs a new UpdateConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an UpdateConnectionRequest. + * @implements IUpdateConnectionRequest + * @constructor + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest=} [properties] Properties to set + */ + function UpdateConnectionRequest(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]]; + } + + /** + * UpdateConnectionRequest connection. + * @member {google.cloud.connectors.v1.IConnection|null|undefined} connection + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @instance + */ + UpdateConnectionRequest.prototype.connection = null; + + /** + * UpdateConnectionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @instance + */ + UpdateConnectionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.UpdateConnectionRequest} UpdateConnectionRequest instance + */ + UpdateConnectionRequest.create = function create(properties) { + return new UpdateConnectionRequest(properties); + }; + + /** + * Encodes the specified UpdateConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.UpdateConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest} message UpdateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateConnectionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + $root.google.cloud.connectors.v1.Connection.encode(message.connection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.UpdateConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest} message UpdateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.UpdateConnectionRequest} UpdateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateConnectionRequest.decode = function 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.connectors.v1.UpdateConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.connection = $root.google.cloud.connectors.v1.Connection.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.UpdateConnectionRequest} UpdateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateConnectionRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateConnectionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connection != null && message.hasOwnProperty("connection")) { + var error = $root.google.cloud.connectors.v1.Connection.verify(message.connection); + if (error) + return "connection." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.UpdateConnectionRequest} UpdateConnectionRequest + */ + UpdateConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.UpdateConnectionRequest) + return object; + var message = new $root.google.cloud.connectors.v1.UpdateConnectionRequest(); + if (object.connection != null) { + if (typeof object.connection !== "object") + throw TypeError(".google.cloud.connectors.v1.UpdateConnectionRequest.connection: object expected"); + message.connection = $root.google.cloud.connectors.v1.Connection.fromObject(object.connection); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.connectors.v1.UpdateConnectionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.UpdateConnectionRequest} message UpdateConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.connection = null; + object.updateMask = null; + } + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = $root.google.cloud.connectors.v1.Connection.toObject(message.connection, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.UpdateConnectionRequest"; + }; + + return UpdateConnectionRequest; + })(); + + v1.DeleteConnectionRequest = (function() { + + /** + * Properties of a DeleteConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @interface IDeleteConnectionRequest + * @property {string|null} [name] DeleteConnectionRequest name + */ + + /** + * Constructs a new DeleteConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a DeleteConnectionRequest. + * @implements IDeleteConnectionRequest + * @constructor + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest=} [properties] Properties to set + */ + function DeleteConnectionRequest(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]]; + } + + /** + * DeleteConnectionRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @instance + */ + DeleteConnectionRequest.prototype.name = ""; + + /** + * Creates a new DeleteConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.DeleteConnectionRequest} DeleteConnectionRequest instance + */ + DeleteConnectionRequest.create = function create(properties) { + return new DeleteConnectionRequest(properties); + }; + + /** + * Encodes the specified DeleteConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.DeleteConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest} message DeleteConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConnectionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.DeleteConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest} message DeleteConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.DeleteConnectionRequest} DeleteConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConnectionRequest.decode = function 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.connectors.v1.DeleteConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.DeleteConnectionRequest} DeleteConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteConnectionRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteConnectionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.DeleteConnectionRequest} DeleteConnectionRequest + */ + DeleteConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.DeleteConnectionRequest) + return object; + var message = new $root.google.cloud.connectors.v1.DeleteConnectionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {google.cloud.connectors.v1.DeleteConnectionRequest} message DeleteConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.DeleteConnectionRequest"; + }; + + return DeleteConnectionRequest; + })(); + + v1.GetConnectionSchemaMetadataRequest = (function() { + + /** + * Properties of a GetConnectionSchemaMetadataRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetConnectionSchemaMetadataRequest + * @property {string|null} [name] GetConnectionSchemaMetadataRequest name + */ + + /** + * Constructs a new GetConnectionSchemaMetadataRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetConnectionSchemaMetadataRequest. + * @implements IGetConnectionSchemaMetadataRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest=} [properties] Properties to set + */ + function GetConnectionSchemaMetadataRequest(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]]; + } + + /** + * GetConnectionSchemaMetadataRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @instance + */ + GetConnectionSchemaMetadataRequest.prototype.name = ""; + + /** + * Creates a new GetConnectionSchemaMetadataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest} GetConnectionSchemaMetadataRequest instance + */ + GetConnectionSchemaMetadataRequest.create = function create(properties) { + return new GetConnectionSchemaMetadataRequest(properties); + }; + + /** + * Encodes the specified GetConnectionSchemaMetadataRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest} message GetConnectionSchemaMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionSchemaMetadataRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetConnectionSchemaMetadataRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest} message GetConnectionSchemaMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionSchemaMetadataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectionSchemaMetadataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest} GetConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionSchemaMetadataRequest.decode = function 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.connectors.v1.GetConnectionSchemaMetadataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConnectionSchemaMetadataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest} GetConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionSchemaMetadataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectionSchemaMetadataRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectionSchemaMetadataRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetConnectionSchemaMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest} GetConnectionSchemaMetadataRequest + */ + GetConnectionSchemaMetadataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetConnectionSchemaMetadataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest} message GetConnectionSchemaMetadataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectionSchemaMetadataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetConnectionSchemaMetadataRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectionSchemaMetadataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectionSchemaMetadataRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectionSchemaMetadataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest"; + }; + + return GetConnectionSchemaMetadataRequest; + })(); + + v1.RefreshConnectionSchemaMetadataRequest = (function() { + + /** + * Properties of a RefreshConnectionSchemaMetadataRequest. + * @memberof google.cloud.connectors.v1 + * @interface IRefreshConnectionSchemaMetadataRequest + * @property {string|null} [name] RefreshConnectionSchemaMetadataRequest name + */ + + /** + * Constructs a new RefreshConnectionSchemaMetadataRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a RefreshConnectionSchemaMetadataRequest. + * @implements IRefreshConnectionSchemaMetadataRequest + * @constructor + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest=} [properties] Properties to set + */ + function RefreshConnectionSchemaMetadataRequest(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]]; + } + + /** + * RefreshConnectionSchemaMetadataRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @instance + */ + RefreshConnectionSchemaMetadataRequest.prototype.name = ""; + + /** + * Creates a new RefreshConnectionSchemaMetadataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest} RefreshConnectionSchemaMetadataRequest instance + */ + RefreshConnectionSchemaMetadataRequest.create = function create(properties) { + return new RefreshConnectionSchemaMetadataRequest(properties); + }; + + /** + * Encodes the specified RefreshConnectionSchemaMetadataRequest message. Does not implicitly {@link google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest} message RefreshConnectionSchemaMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RefreshConnectionSchemaMetadataRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified RefreshConnectionSchemaMetadataRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest} message RefreshConnectionSchemaMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RefreshConnectionSchemaMetadataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RefreshConnectionSchemaMetadataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest} RefreshConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RefreshConnectionSchemaMetadataRequest.decode = function 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.connectors.v1.RefreshConnectionSchemaMetadataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RefreshConnectionSchemaMetadataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest} RefreshConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RefreshConnectionSchemaMetadataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RefreshConnectionSchemaMetadataRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RefreshConnectionSchemaMetadataRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a RefreshConnectionSchemaMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest} RefreshConnectionSchemaMetadataRequest + */ + RefreshConnectionSchemaMetadataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest) + return object; + var message = new $root.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RefreshConnectionSchemaMetadataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest} message RefreshConnectionSchemaMetadataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RefreshConnectionSchemaMetadataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this RefreshConnectionSchemaMetadataRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @instance + * @returns {Object.} JSON object + */ + RefreshConnectionSchemaMetadataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RefreshConnectionSchemaMetadataRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RefreshConnectionSchemaMetadataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest"; + }; + + return RefreshConnectionSchemaMetadataRequest; + })(); + + v1.ListRuntimeEntitySchemasRequest = (function() { + + /** + * Properties of a ListRuntimeEntitySchemasRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListRuntimeEntitySchemasRequest + * @property {string|null} [parent] ListRuntimeEntitySchemasRequest parent + * @property {number|null} [pageSize] ListRuntimeEntitySchemasRequest pageSize + * @property {string|null} [pageToken] ListRuntimeEntitySchemasRequest pageToken + * @property {string|null} [filter] ListRuntimeEntitySchemasRequest filter + */ + + /** + * Constructs a new ListRuntimeEntitySchemasRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListRuntimeEntitySchemasRequest. + * @implements IListRuntimeEntitySchemasRequest + * @constructor + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest=} [properties] Properties to set + */ + function ListRuntimeEntitySchemasRequest(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]]; + } + + /** + * ListRuntimeEntitySchemasRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @instance + */ + ListRuntimeEntitySchemasRequest.prototype.parent = ""; + + /** + * ListRuntimeEntitySchemasRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @instance + */ + ListRuntimeEntitySchemasRequest.prototype.pageSize = 0; + + /** + * ListRuntimeEntitySchemasRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @instance + */ + ListRuntimeEntitySchemasRequest.prototype.pageToken = ""; + + /** + * ListRuntimeEntitySchemasRequest filter. + * @member {string} filter + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @instance + */ + ListRuntimeEntitySchemasRequest.prototype.filter = ""; + + /** + * Creates a new ListRuntimeEntitySchemasRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest} ListRuntimeEntitySchemasRequest instance + */ + ListRuntimeEntitySchemasRequest.create = function create(properties) { + return new ListRuntimeEntitySchemasRequest(properties); + }; + + /** + * Encodes the specified ListRuntimeEntitySchemasRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest} message ListRuntimeEntitySchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeEntitySchemasRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListRuntimeEntitySchemasRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest} message ListRuntimeEntitySchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeEntitySchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeEntitySchemasRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest} ListRuntimeEntitySchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeEntitySchemasRequest.decode = function 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.connectors.v1.ListRuntimeEntitySchemasRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeEntitySchemasRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest} ListRuntimeEntitySchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeEntitySchemasRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeEntitySchemasRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeEntitySchemasRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListRuntimeEntitySchemasRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest} ListRuntimeEntitySchemasRequest + */ + ListRuntimeEntitySchemasRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeEntitySchemasRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest} message ListRuntimeEntitySchemasRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeEntitySchemasRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListRuntimeEntitySchemasRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeEntitySchemasRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeEntitySchemasRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeEntitySchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest"; + }; + + return ListRuntimeEntitySchemasRequest; + })(); + + v1.ListRuntimeEntitySchemasResponse = (function() { + + /** + * Properties of a ListRuntimeEntitySchemasResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListRuntimeEntitySchemasResponse + * @property {Array.|null} [runtimeEntitySchemas] ListRuntimeEntitySchemasResponse runtimeEntitySchemas + * @property {string|null} [nextPageToken] ListRuntimeEntitySchemasResponse nextPageToken + */ + + /** + * Constructs a new ListRuntimeEntitySchemasResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListRuntimeEntitySchemasResponse. + * @implements IListRuntimeEntitySchemasResponse + * @constructor + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse=} [properties] Properties to set + */ + function ListRuntimeEntitySchemasResponse(properties) { + this.runtimeEntitySchemas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRuntimeEntitySchemasResponse runtimeEntitySchemas. + * @member {Array.} runtimeEntitySchemas + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @instance + */ + ListRuntimeEntitySchemasResponse.prototype.runtimeEntitySchemas = $util.emptyArray; + + /** + * ListRuntimeEntitySchemasResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @instance + */ + ListRuntimeEntitySchemasResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRuntimeEntitySchemasResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} ListRuntimeEntitySchemasResponse instance + */ + ListRuntimeEntitySchemasResponse.create = function create(properties) { + return new ListRuntimeEntitySchemasResponse(properties); + }; + + /** + * Encodes the specified ListRuntimeEntitySchemasResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse} message ListRuntimeEntitySchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeEntitySchemasResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runtimeEntitySchemas != null && message.runtimeEntitySchemas.length) + for (var i = 0; i < message.runtimeEntitySchemas.length; ++i) + $root.google.cloud.connectors.v1.RuntimeEntitySchema.encode(message.runtimeEntitySchemas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListRuntimeEntitySchemasResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse} message ListRuntimeEntitySchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeEntitySchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeEntitySchemasResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} ListRuntimeEntitySchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeEntitySchemasResponse.decode = function 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.connectors.v1.ListRuntimeEntitySchemasResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.runtimeEntitySchemas && message.runtimeEntitySchemas.length)) + message.runtimeEntitySchemas = []; + message.runtimeEntitySchemas.push($root.google.cloud.connectors.v1.RuntimeEntitySchema.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeEntitySchemasResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} ListRuntimeEntitySchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeEntitySchemasResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeEntitySchemasResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeEntitySchemasResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runtimeEntitySchemas != null && message.hasOwnProperty("runtimeEntitySchemas")) { + if (!Array.isArray(message.runtimeEntitySchemas)) + return "runtimeEntitySchemas: array expected"; + for (var i = 0; i < message.runtimeEntitySchemas.length; ++i) { + var error = $root.google.cloud.connectors.v1.RuntimeEntitySchema.verify(message.runtimeEntitySchemas[i]); + if (error) + return "runtimeEntitySchemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRuntimeEntitySchemasResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} ListRuntimeEntitySchemasResponse + */ + ListRuntimeEntitySchemasResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse(); + if (object.runtimeEntitySchemas) { + if (!Array.isArray(object.runtimeEntitySchemas)) + throw TypeError(".google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.runtimeEntitySchemas: array expected"); + message.runtimeEntitySchemas = []; + for (var i = 0; i < object.runtimeEntitySchemas.length; ++i) { + if (typeof object.runtimeEntitySchemas[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.runtimeEntitySchemas: object expected"); + message.runtimeEntitySchemas[i] = $root.google.cloud.connectors.v1.RuntimeEntitySchema.fromObject(object.runtimeEntitySchemas[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeEntitySchemasResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} message ListRuntimeEntitySchemasResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeEntitySchemasResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.runtimeEntitySchemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.runtimeEntitySchemas && message.runtimeEntitySchemas.length) { + object.runtimeEntitySchemas = []; + for (var j = 0; j < message.runtimeEntitySchemas.length; ++j) + object.runtimeEntitySchemas[j] = $root.google.cloud.connectors.v1.RuntimeEntitySchema.toObject(message.runtimeEntitySchemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRuntimeEntitySchemasResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeEntitySchemasResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeEntitySchemasResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeEntitySchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse"; + }; + + return ListRuntimeEntitySchemasResponse; + })(); + + v1.ListRuntimeActionSchemasRequest = (function() { + + /** + * Properties of a ListRuntimeActionSchemasRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListRuntimeActionSchemasRequest + * @property {string|null} [parent] ListRuntimeActionSchemasRequest parent + * @property {number|null} [pageSize] ListRuntimeActionSchemasRequest pageSize + * @property {string|null} [pageToken] ListRuntimeActionSchemasRequest pageToken + * @property {string|null} [filter] ListRuntimeActionSchemasRequest filter + */ + + /** + * Constructs a new ListRuntimeActionSchemasRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListRuntimeActionSchemasRequest. + * @implements IListRuntimeActionSchemasRequest + * @constructor + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest=} [properties] Properties to set + */ + function ListRuntimeActionSchemasRequest(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]]; + } + + /** + * ListRuntimeActionSchemasRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @instance + */ + ListRuntimeActionSchemasRequest.prototype.parent = ""; + + /** + * ListRuntimeActionSchemasRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @instance + */ + ListRuntimeActionSchemasRequest.prototype.pageSize = 0; + + /** + * ListRuntimeActionSchemasRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @instance + */ + ListRuntimeActionSchemasRequest.prototype.pageToken = ""; + + /** + * ListRuntimeActionSchemasRequest filter. + * @member {string} filter + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @instance + */ + ListRuntimeActionSchemasRequest.prototype.filter = ""; + + /** + * Creates a new ListRuntimeActionSchemasRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasRequest} ListRuntimeActionSchemasRequest instance + */ + ListRuntimeActionSchemasRequest.create = function create(properties) { + return new ListRuntimeActionSchemasRequest(properties); + }; + + /** + * Encodes the specified ListRuntimeActionSchemasRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest} message ListRuntimeActionSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeActionSchemasRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListRuntimeActionSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest} message ListRuntimeActionSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeActionSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeActionSchemasRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasRequest} ListRuntimeActionSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeActionSchemasRequest.decode = function 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.connectors.v1.ListRuntimeActionSchemasRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeActionSchemasRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasRequest} ListRuntimeActionSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeActionSchemasRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeActionSchemasRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeActionSchemasRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListRuntimeActionSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasRequest} ListRuntimeActionSchemasRequest + */ + ListRuntimeActionSchemasRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeActionSchemasRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {google.cloud.connectors.v1.ListRuntimeActionSchemasRequest} message ListRuntimeActionSchemasRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeActionSchemasRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListRuntimeActionSchemasRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeActionSchemasRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeActionSchemasRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeActionSchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListRuntimeActionSchemasRequest"; + }; + + return ListRuntimeActionSchemasRequest; + })(); + + v1.ListRuntimeActionSchemasResponse = (function() { + + /** + * Properties of a ListRuntimeActionSchemasResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListRuntimeActionSchemasResponse + * @property {Array.|null} [runtimeActionSchemas] ListRuntimeActionSchemasResponse runtimeActionSchemas + * @property {string|null} [nextPageToken] ListRuntimeActionSchemasResponse nextPageToken + */ + + /** + * Constructs a new ListRuntimeActionSchemasResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListRuntimeActionSchemasResponse. + * @implements IListRuntimeActionSchemasResponse + * @constructor + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasResponse=} [properties] Properties to set + */ + function ListRuntimeActionSchemasResponse(properties) { + this.runtimeActionSchemas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRuntimeActionSchemasResponse runtimeActionSchemas. + * @member {Array.} runtimeActionSchemas + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @instance + */ + ListRuntimeActionSchemasResponse.prototype.runtimeActionSchemas = $util.emptyArray; + + /** + * ListRuntimeActionSchemasResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @instance + */ + ListRuntimeActionSchemasResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRuntimeActionSchemasResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} ListRuntimeActionSchemasResponse instance + */ + ListRuntimeActionSchemasResponse.create = function create(properties) { + return new ListRuntimeActionSchemasResponse(properties); + }; + + /** + * Encodes the specified ListRuntimeActionSchemasResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasResponse} message ListRuntimeActionSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeActionSchemasResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runtimeActionSchemas != null && message.runtimeActionSchemas.length) + for (var i = 0; i < message.runtimeActionSchemas.length; ++i) + $root.google.cloud.connectors.v1.RuntimeActionSchema.encode(message.runtimeActionSchemas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListRuntimeActionSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasResponse} message ListRuntimeActionSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeActionSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeActionSchemasResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} ListRuntimeActionSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeActionSchemasResponse.decode = function 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.connectors.v1.ListRuntimeActionSchemasResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.runtimeActionSchemas && message.runtimeActionSchemas.length)) + message.runtimeActionSchemas = []; + message.runtimeActionSchemas.push($root.google.cloud.connectors.v1.RuntimeActionSchema.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeActionSchemasResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} ListRuntimeActionSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeActionSchemasResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeActionSchemasResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeActionSchemasResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runtimeActionSchemas != null && message.hasOwnProperty("runtimeActionSchemas")) { + if (!Array.isArray(message.runtimeActionSchemas)) + return "runtimeActionSchemas: array expected"; + for (var i = 0; i < message.runtimeActionSchemas.length; ++i) { + var error = $root.google.cloud.connectors.v1.RuntimeActionSchema.verify(message.runtimeActionSchemas[i]); + if (error) + return "runtimeActionSchemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRuntimeActionSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} ListRuntimeActionSchemasResponse + */ + ListRuntimeActionSchemasResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListRuntimeActionSchemasResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListRuntimeActionSchemasResponse(); + if (object.runtimeActionSchemas) { + if (!Array.isArray(object.runtimeActionSchemas)) + throw TypeError(".google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.runtimeActionSchemas: array expected"); + message.runtimeActionSchemas = []; + for (var i = 0; i < object.runtimeActionSchemas.length; ++i) { + if (typeof object.runtimeActionSchemas[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.runtimeActionSchemas: object expected"); + message.runtimeActionSchemas[i] = $root.google.cloud.connectors.v1.RuntimeActionSchema.fromObject(object.runtimeActionSchemas[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeActionSchemasResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} message ListRuntimeActionSchemasResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeActionSchemasResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.runtimeActionSchemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.runtimeActionSchemas && message.runtimeActionSchemas.length) { + object.runtimeActionSchemas = []; + for (var j = 0; j < message.runtimeActionSchemas.length; ++j) + object.runtimeActionSchemas[j] = $root.google.cloud.connectors.v1.RuntimeActionSchema.toObject(message.runtimeActionSchemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRuntimeActionSchemasResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeActionSchemasResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeActionSchemasResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeActionSchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListRuntimeActionSchemasResponse"; + }; + + return ListRuntimeActionSchemasResponse; + })(); + + v1.ConnectionStatus = (function() { + + /** + * Properties of a ConnectionStatus. + * @memberof google.cloud.connectors.v1 + * @interface IConnectionStatus + * @property {google.cloud.connectors.v1.ConnectionStatus.State|null} [state] ConnectionStatus state + * @property {string|null} [description] ConnectionStatus description + * @property {string|null} [status] ConnectionStatus status + */ + + /** + * Constructs a new ConnectionStatus. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ConnectionStatus. + * @implements IConnectionStatus + * @constructor + * @param {google.cloud.connectors.v1.IConnectionStatus=} [properties] Properties to set + */ + function ConnectionStatus(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]]; + } + + /** + * ConnectionStatus state. + * @member {google.cloud.connectors.v1.ConnectionStatus.State} state + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @instance + */ + ConnectionStatus.prototype.state = 0; + + /** + * ConnectionStatus description. + * @member {string} description + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @instance + */ + ConnectionStatus.prototype.description = ""; + + /** + * ConnectionStatus status. + * @member {string} status + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @instance + */ + ConnectionStatus.prototype.status = ""; + + /** + * Creates a new ConnectionStatus instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {google.cloud.connectors.v1.IConnectionStatus=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ConnectionStatus} ConnectionStatus instance + */ + ConnectionStatus.create = function create(properties) { + return new ConnectionStatus(properties); + }; + + /** + * Encodes the specified ConnectionStatus message. Does not implicitly {@link google.cloud.connectors.v1.ConnectionStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {google.cloud.connectors.v1.IConnectionStatus} message ConnectionStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.status); + return writer; + }; + + /** + * Encodes the specified ConnectionStatus message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectionStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {google.cloud.connectors.v1.IConnectionStatus} message ConnectionStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ConnectionStatus} ConnectionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionStatus.decode = function 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.connectors.v1.ConnectionStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.status = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ConnectionStatus} ConnectionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionStatus message. + * @function verify + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + return null; + }; + + /** + * Creates a ConnectionStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ConnectionStatus} ConnectionStatus + */ + ConnectionStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ConnectionStatus) + return object; + var message = new $root.google.cloud.connectors.v1.ConnectionStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "INACTIVE": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "UPDATING": + case 5: + message.state = 5; + break; + case "ERROR": + case 6: + message.state = 6; + break; + case "AUTHORIZATION_REQUIRED": + case 7: + message.state = 7; + break; + } + if (object.description != null) + message.description = String(object.description); + if (object.status != null) + message.status = String(object.status); + return message; + }; + + /** + * Creates a plain object from a ConnectionStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {google.cloud.connectors.v1.ConnectionStatus} message ConnectionStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.description = ""; + object.status = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.connectors.v1.ConnectionStatus.State[message.state] === undefined ? message.state : $root.google.cloud.connectors.v1.ConnectionStatus.State[message.state] : message.state; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + return object; + }; + + /** + * Converts this ConnectionStatus to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @instance + * @returns {Object.} JSON object + */ + ConnectionStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionStatus + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ConnectionStatus"; + }; + + /** + * State enum. + * @name google.cloud.connectors.v1.ConnectionStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} INACTIVE=3 INACTIVE value + * @property {number} DELETING=4 DELETING value + * @property {number} UPDATING=5 UPDATING value + * @property {number} ERROR=6 ERROR value + * @property {number} AUTHORIZATION_REQUIRED=7 AUTHORIZATION_REQUIRED value + */ + ConnectionStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "INACTIVE"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "UPDATING"] = 5; + values[valuesById[6] = "ERROR"] = 6; + values[valuesById[7] = "AUTHORIZATION_REQUIRED"] = 7; + return values; + })(); + + return ConnectionStatus; + })(); + + /** + * DataType enum. + * @name google.cloud.connectors.v1.DataType + * @enum {number} + * @property {number} DATA_TYPE_UNSPECIFIED=0 DATA_TYPE_UNSPECIFIED value + * @property {number} DATA_TYPE_INT=1 DATA_TYPE_INT value + * @property {number} DATA_TYPE_SMALLINT=2 DATA_TYPE_SMALLINT value + * @property {number} DATA_TYPE_DOUBLE=3 DATA_TYPE_DOUBLE value + * @property {number} DATA_TYPE_DATE=4 DATA_TYPE_DATE value + * @property {number} DATA_TYPE_DATETIME=5 DATA_TYPE_DATETIME value + * @property {number} DATA_TYPE_TIME=6 DATA_TYPE_TIME value + * @property {number} DATA_TYPE_STRING=7 DATA_TYPE_STRING value + * @property {number} DATA_TYPE_LONG=8 DATA_TYPE_LONG value + * @property {number} DATA_TYPE_BOOLEAN=9 DATA_TYPE_BOOLEAN value + * @property {number} DATA_TYPE_DECIMAL=10 DATA_TYPE_DECIMAL value + * @property {number} DATA_TYPE_UUID=11 DATA_TYPE_UUID value + * @property {number} DATA_TYPE_BLOB=12 DATA_TYPE_BLOB value + * @property {number} DATA_TYPE_BIT=13 DATA_TYPE_BIT value + * @property {number} DATA_TYPE_TINYINT=14 DATA_TYPE_TINYINT value + * @property {number} DATA_TYPE_INTEGER=15 DATA_TYPE_INTEGER value + * @property {number} DATA_TYPE_BIGINT=16 DATA_TYPE_BIGINT value + * @property {number} DATA_TYPE_FLOAT=17 DATA_TYPE_FLOAT value + * @property {number} DATA_TYPE_REAL=18 DATA_TYPE_REAL value + * @property {number} DATA_TYPE_NUMERIC=19 DATA_TYPE_NUMERIC value + * @property {number} DATA_TYPE_CHAR=20 DATA_TYPE_CHAR value + * @property {number} DATA_TYPE_VARCHAR=21 DATA_TYPE_VARCHAR value + * @property {number} DATA_TYPE_LONGVARCHAR=22 DATA_TYPE_LONGVARCHAR value + * @property {number} DATA_TYPE_TIMESTAMP=23 DATA_TYPE_TIMESTAMP value + * @property {number} DATA_TYPE_NCHAR=24 DATA_TYPE_NCHAR value + * @property {number} DATA_TYPE_NVARCHAR=25 DATA_TYPE_NVARCHAR value + * @property {number} DATA_TYPE_LONGNVARCHAR=26 DATA_TYPE_LONGNVARCHAR value + * @property {number} DATA_TYPE_NULL=27 DATA_TYPE_NULL value + * @property {number} DATA_TYPE_OTHER=28 DATA_TYPE_OTHER value + * @property {number} DATA_TYPE_JAVA_OBJECT=29 DATA_TYPE_JAVA_OBJECT value + * @property {number} DATA_TYPE_DISTINCT=30 DATA_TYPE_DISTINCT value + * @property {number} DATA_TYPE_STRUCT=31 DATA_TYPE_STRUCT value + * @property {number} DATA_TYPE_ARRAY=32 DATA_TYPE_ARRAY value + * @property {number} DATA_TYPE_CLOB=33 DATA_TYPE_CLOB value + * @property {number} DATA_TYPE_REF=34 DATA_TYPE_REF value + * @property {number} DATA_TYPE_DATALINK=35 DATA_TYPE_DATALINK value + * @property {number} DATA_TYPE_ROWID=36 DATA_TYPE_ROWID value + * @property {number} DATA_TYPE_BINARY=37 DATA_TYPE_BINARY value + * @property {number} DATA_TYPE_VARBINARY=38 DATA_TYPE_VARBINARY value + * @property {number} DATA_TYPE_LONGVARBINARY=39 DATA_TYPE_LONGVARBINARY value + * @property {number} DATA_TYPE_NCLOB=40 DATA_TYPE_NCLOB value + * @property {number} DATA_TYPE_SQLXML=41 DATA_TYPE_SQLXML value + * @property {number} DATA_TYPE_REF_CURSOR=42 DATA_TYPE_REF_CURSOR value + * @property {number} DATA_TYPE_TIME_WITH_TIMEZONE=43 DATA_TYPE_TIME_WITH_TIMEZONE value + * @property {number} DATA_TYPE_TIMESTAMP_WITH_TIMEZONE=44 DATA_TYPE_TIMESTAMP_WITH_TIMEZONE value + */ + v1.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATA_TYPE_INT"] = 1; + values[valuesById[2] = "DATA_TYPE_SMALLINT"] = 2; + values[valuesById[3] = "DATA_TYPE_DOUBLE"] = 3; + values[valuesById[4] = "DATA_TYPE_DATE"] = 4; + values[valuesById[5] = "DATA_TYPE_DATETIME"] = 5; + values[valuesById[6] = "DATA_TYPE_TIME"] = 6; + values[valuesById[7] = "DATA_TYPE_STRING"] = 7; + values[valuesById[8] = "DATA_TYPE_LONG"] = 8; + values[valuesById[9] = "DATA_TYPE_BOOLEAN"] = 9; + values[valuesById[10] = "DATA_TYPE_DECIMAL"] = 10; + values[valuesById[11] = "DATA_TYPE_UUID"] = 11; + values[valuesById[12] = "DATA_TYPE_BLOB"] = 12; + values[valuesById[13] = "DATA_TYPE_BIT"] = 13; + values[valuesById[14] = "DATA_TYPE_TINYINT"] = 14; + values[valuesById[15] = "DATA_TYPE_INTEGER"] = 15; + values[valuesById[16] = "DATA_TYPE_BIGINT"] = 16; + values[valuesById[17] = "DATA_TYPE_FLOAT"] = 17; + values[valuesById[18] = "DATA_TYPE_REAL"] = 18; + values[valuesById[19] = "DATA_TYPE_NUMERIC"] = 19; + values[valuesById[20] = "DATA_TYPE_CHAR"] = 20; + values[valuesById[21] = "DATA_TYPE_VARCHAR"] = 21; + values[valuesById[22] = "DATA_TYPE_LONGVARCHAR"] = 22; + values[valuesById[23] = "DATA_TYPE_TIMESTAMP"] = 23; + values[valuesById[24] = "DATA_TYPE_NCHAR"] = 24; + values[valuesById[25] = "DATA_TYPE_NVARCHAR"] = 25; + values[valuesById[26] = "DATA_TYPE_LONGNVARCHAR"] = 26; + values[valuesById[27] = "DATA_TYPE_NULL"] = 27; + values[valuesById[28] = "DATA_TYPE_OTHER"] = 28; + values[valuesById[29] = "DATA_TYPE_JAVA_OBJECT"] = 29; + values[valuesById[30] = "DATA_TYPE_DISTINCT"] = 30; + values[valuesById[31] = "DATA_TYPE_STRUCT"] = 31; + values[valuesById[32] = "DATA_TYPE_ARRAY"] = 32; + values[valuesById[33] = "DATA_TYPE_CLOB"] = 33; + values[valuesById[34] = "DATA_TYPE_REF"] = 34; + values[valuesById[35] = "DATA_TYPE_DATALINK"] = 35; + values[valuesById[36] = "DATA_TYPE_ROWID"] = 36; + values[valuesById[37] = "DATA_TYPE_BINARY"] = 37; + values[valuesById[38] = "DATA_TYPE_VARBINARY"] = 38; + values[valuesById[39] = "DATA_TYPE_LONGVARBINARY"] = 39; + values[valuesById[40] = "DATA_TYPE_NCLOB"] = 40; + values[valuesById[41] = "DATA_TYPE_SQLXML"] = 41; + values[valuesById[42] = "DATA_TYPE_REF_CURSOR"] = 42; + values[valuesById[43] = "DATA_TYPE_TIME_WITH_TIMEZONE"] = 43; + values[valuesById[44] = "DATA_TYPE_TIMESTAMP_WITH_TIMEZONE"] = 44; + return values; + })(); + + /** + * ConnectionView enum. + * @name google.cloud.connectors.v1.ConnectionView + * @enum {number} + * @property {number} CONNECTION_VIEW_UNSPECIFIED=0 CONNECTION_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.ConnectionView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONNECTION_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + v1.DestinationConfig = (function() { + + /** + * Properties of a DestinationConfig. + * @memberof google.cloud.connectors.v1 + * @interface IDestinationConfig + * @property {string|null} [key] DestinationConfig key + * @property {Array.|null} [destinations] DestinationConfig destinations + */ + + /** + * Constructs a new DestinationConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a DestinationConfig. + * @implements IDestinationConfig + * @constructor + * @param {google.cloud.connectors.v1.IDestinationConfig=} [properties] Properties to set + */ + function DestinationConfig(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DestinationConfig key. + * @member {string} key + * @memberof google.cloud.connectors.v1.DestinationConfig + * @instance + */ + DestinationConfig.prototype.key = ""; + + /** + * DestinationConfig destinations. + * @member {Array.} destinations + * @memberof google.cloud.connectors.v1.DestinationConfig + * @instance + */ + DestinationConfig.prototype.destinations = $util.emptyArray; + + /** + * Creates a new DestinationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {google.cloud.connectors.v1.IDestinationConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.DestinationConfig} DestinationConfig instance + */ + DestinationConfig.create = function create(properties) { + return new DestinationConfig(properties); + }; + + /** + * Encodes the specified DestinationConfig message. Does not implicitly {@link google.cloud.connectors.v1.DestinationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {google.cloud.connectors.v1.IDestinationConfig} message DestinationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.destinations != null && message.destinations.length) + for (var i = 0; i < message.destinations.length; ++i) + $root.google.cloud.connectors.v1.Destination.encode(message.destinations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DestinationConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.DestinationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {google.cloud.connectors.v1.IDestinationConfig} message DestinationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DestinationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.DestinationConfig} DestinationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationConfig.decode = function 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.connectors.v1.DestinationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + message.destinations.push($root.google.cloud.connectors.v1.Destination.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DestinationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.DestinationConfig} DestinationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestinationConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestinationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) { + var error = $root.google.cloud.connectors.v1.Destination.verify(message.destinations[i]); + if (error) + return "destinations." + error; + } + } + return null; + }; + + /** + * Creates a DestinationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.DestinationConfig} DestinationConfig + */ + DestinationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.DestinationConfig) + return object; + var message = new $root.google.cloud.connectors.v1.DestinationConfig(); + if (object.key != null) + message.key = String(object.key); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.cloud.connectors.v1.DestinationConfig.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) { + if (typeof object.destinations[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.DestinationConfig.destinations: object expected"); + message.destinations[i] = $root.google.cloud.connectors.v1.Destination.fromObject(object.destinations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DestinationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {google.cloud.connectors.v1.DestinationConfig} message DestinationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestinationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.key = ""; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = $root.google.cloud.connectors.v1.Destination.toObject(message.destinations[j], options); + } + return object; + }; + + /** + * Converts this DestinationConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.DestinationConfig + * @instance + * @returns {Object.} JSON object + */ + DestinationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DestinationConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DestinationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.DestinationConfig"; + }; + + return DestinationConfig; + })(); + + v1.Destination = (function() { + + /** + * Properties of a Destination. + * @memberof google.cloud.connectors.v1 + * @interface IDestination + * @property {string|null} [serviceAttachment] Destination serviceAttachment + * @property {string|null} [host] Destination host + * @property {number|null} [port] Destination port + */ + + /** + * Constructs a new Destination. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Destination. + * @implements IDestination + * @constructor + * @param {google.cloud.connectors.v1.IDestination=} [properties] Properties to set + */ + function Destination(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]]; + } + + /** + * Destination serviceAttachment. + * @member {string|null|undefined} serviceAttachment + * @memberof google.cloud.connectors.v1.Destination + * @instance + */ + Destination.prototype.serviceAttachment = null; + + /** + * Destination host. + * @member {string|null|undefined} host + * @memberof google.cloud.connectors.v1.Destination + * @instance + */ + Destination.prototype.host = null; + + /** + * Destination port. + * @member {number} port + * @memberof google.cloud.connectors.v1.Destination + * @instance + */ + Destination.prototype.port = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Destination destination. + * @member {"serviceAttachment"|"host"|undefined} destination + * @memberof google.cloud.connectors.v1.Destination + * @instance + */ + Object.defineProperty(Destination.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["serviceAttachment", "host"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Destination instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {google.cloud.connectors.v1.IDestination=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Destination} Destination instance + */ + Destination.create = function create(properties) { + return new Destination(properties); + }; + + /** + * Encodes the specified Destination message. Does not implicitly {@link google.cloud.connectors.v1.Destination.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {google.cloud.connectors.v1.IDestination} message Destination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Destination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAttachment != null && Object.hasOwnProperty.call(message, "serviceAttachment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAttachment); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.port); + return writer; + }; + + /** + * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Destination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {google.cloud.connectors.v1.IDestination} message Destination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Destination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Destination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Destination} Destination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Destination.decode = function 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.connectors.v1.Destination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceAttachment = reader.string(); + break; + } + case 2: { + message.host = reader.string(); + break; + } + case 3: { + message.port = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Destination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Destination} Destination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Destination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Destination message. + * @function verify + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Destination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.serviceAttachment != null && message.hasOwnProperty("serviceAttachment")) { + properties.destination = 1; + if (!$util.isString(message.serviceAttachment)) + return "serviceAttachment: string expected"; + } + if (message.host != null && message.hasOwnProperty("host")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + if (!$util.isString(message.host)) + return "host: string expected"; + } + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + return null; + }; + + /** + * Creates a Destination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Destination} Destination + */ + Destination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Destination) + return object; + var message = new $root.google.cloud.connectors.v1.Destination(); + if (object.serviceAttachment != null) + message.serviceAttachment = String(object.serviceAttachment); + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + return message; + }; + + /** + * Creates a plain object from a Destination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {google.cloud.connectors.v1.Destination} message Destination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Destination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.port = 0; + if (message.serviceAttachment != null && message.hasOwnProperty("serviceAttachment")) { + object.serviceAttachment = message.serviceAttachment; + if (options.oneofs) + object.destination = "serviceAttachment"; + } + if (message.host != null && message.hasOwnProperty("host")) { + object.host = message.host; + if (options.oneofs) + object.destination = "host"; + } + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + return object; + }; + + /** + * Converts this Destination to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Destination + * @instance + * @returns {Object.} JSON object + */ + Destination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Destination + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Destination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Destination"; + }; + + return Destination; + })(); + + v1.SslConfigTemplate = (function() { + + /** + * Properties of a SslConfigTemplate. + * @memberof google.cloud.connectors.v1 + * @interface ISslConfigTemplate + * @property {google.cloud.connectors.v1.SslType|null} [sslType] SslConfigTemplate sslType + * @property {boolean|null} [isTlsMandatory] SslConfigTemplate isTlsMandatory + * @property {Array.|null} [serverCertType] SslConfigTemplate serverCertType + * @property {Array.|null} [clientCertType] SslConfigTemplate clientCertType + * @property {Array.|null} [additionalVariables] SslConfigTemplate additionalVariables + */ + + /** + * Constructs a new SslConfigTemplate. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a SslConfigTemplate. + * @implements ISslConfigTemplate + * @constructor + * @param {google.cloud.connectors.v1.ISslConfigTemplate=} [properties] Properties to set + */ + function SslConfigTemplate(properties) { + this.serverCertType = []; + this.clientCertType = []; + this.additionalVariables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslConfigTemplate sslType. + * @member {google.cloud.connectors.v1.SslType} sslType + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + */ + SslConfigTemplate.prototype.sslType = 0; + + /** + * SslConfigTemplate isTlsMandatory. + * @member {boolean} isTlsMandatory + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + */ + SslConfigTemplate.prototype.isTlsMandatory = false; + + /** + * SslConfigTemplate serverCertType. + * @member {Array.} serverCertType + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + */ + SslConfigTemplate.prototype.serverCertType = $util.emptyArray; + + /** + * SslConfigTemplate clientCertType. + * @member {Array.} clientCertType + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + */ + SslConfigTemplate.prototype.clientCertType = $util.emptyArray; + + /** + * SslConfigTemplate additionalVariables. + * @member {Array.} additionalVariables + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + */ + SslConfigTemplate.prototype.additionalVariables = $util.emptyArray; + + /** + * Creates a new SslConfigTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {google.cloud.connectors.v1.ISslConfigTemplate=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.SslConfigTemplate} SslConfigTemplate instance + */ + SslConfigTemplate.create = function create(properties) { + return new SslConfigTemplate(properties); + }; + + /** + * Encodes the specified SslConfigTemplate message. Does not implicitly {@link google.cloud.connectors.v1.SslConfigTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {google.cloud.connectors.v1.ISslConfigTemplate} message SslConfigTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfigTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslType != null && Object.hasOwnProperty.call(message, "sslType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslType); + if (message.isTlsMandatory != null && Object.hasOwnProperty.call(message, "isTlsMandatory")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isTlsMandatory); + if (message.serverCertType != null && message.serverCertType.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.serverCertType.length; ++i) + writer.int32(message.serverCertType[i]); + writer.ldelim(); + } + if (message.clientCertType != null && message.clientCertType.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.clientCertType.length; ++i) + writer.int32(message.clientCertType[i]); + writer.ldelim(); + } + if (message.additionalVariables != null && message.additionalVariables.length) + for (var i = 0; i < message.additionalVariables.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariableTemplate.encode(message.additionalVariables[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SslConfigTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SslConfigTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {google.cloud.connectors.v1.ISslConfigTemplate} message SslConfigTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfigTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslConfigTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.SslConfigTemplate} SslConfigTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfigTemplate.decode = function 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.connectors.v1.SslConfigTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sslType = reader.int32(); + break; + } + case 2: { + message.isTlsMandatory = reader.bool(); + break; + } + case 3: { + if (!(message.serverCertType && message.serverCertType.length)) + message.serverCertType = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.serverCertType.push(reader.int32()); + } else + message.serverCertType.push(reader.int32()); + break; + } + case 4: { + if (!(message.clientCertType && message.clientCertType.length)) + message.clientCertType = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.clientCertType.push(reader.int32()); + } else + message.clientCertType.push(reader.int32()); + break; + } + case 5: { + if (!(message.additionalVariables && message.additionalVariables.length)) + message.additionalVariables = []; + message.additionalVariables.push($root.google.cloud.connectors.v1.ConfigVariableTemplate.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslConfigTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.SslConfigTemplate} SslConfigTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfigTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslConfigTemplate message. + * @function verify + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslConfigTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sslType != null && message.hasOwnProperty("sslType")) + switch (message.sslType) { + default: + return "sslType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.isTlsMandatory != null && message.hasOwnProperty("isTlsMandatory")) + if (typeof message.isTlsMandatory !== "boolean") + return "isTlsMandatory: boolean expected"; + if (message.serverCertType != null && message.hasOwnProperty("serverCertType")) { + if (!Array.isArray(message.serverCertType)) + return "serverCertType: array expected"; + for (var i = 0; i < message.serverCertType.length; ++i) + switch (message.serverCertType[i]) { + default: + return "serverCertType: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.clientCertType != null && message.hasOwnProperty("clientCertType")) { + if (!Array.isArray(message.clientCertType)) + return "clientCertType: array expected"; + for (var i = 0; i < message.clientCertType.length; ++i) + switch (message.clientCertType[i]) { + default: + return "clientCertType: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.additionalVariables != null && message.hasOwnProperty("additionalVariables")) { + if (!Array.isArray(message.additionalVariables)) + return "additionalVariables: array expected"; + for (var i = 0; i < message.additionalVariables.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariableTemplate.verify(message.additionalVariables[i]); + if (error) + return "additionalVariables." + error; + } + } + return null; + }; + + /** + * Creates a SslConfigTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.SslConfigTemplate} SslConfigTemplate + */ + SslConfigTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.SslConfigTemplate) + return object; + var message = new $root.google.cloud.connectors.v1.SslConfigTemplate(); + switch (object.sslType) { + default: + if (typeof object.sslType === "number") { + message.sslType = object.sslType; + break; + } + break; + case "SSL_TYPE_UNSPECIFIED": + case 0: + message.sslType = 0; + break; + case "TLS": + case 1: + message.sslType = 1; + break; + case "MTLS": + case 2: + message.sslType = 2; + break; + } + if (object.isTlsMandatory != null) + message.isTlsMandatory = Boolean(object.isTlsMandatory); + if (object.serverCertType) { + if (!Array.isArray(object.serverCertType)) + throw TypeError(".google.cloud.connectors.v1.SslConfigTemplate.serverCertType: array expected"); + message.serverCertType = []; + for (var i = 0; i < object.serverCertType.length; ++i) + switch (object.serverCertType[i]) { + default: + if (typeof object.serverCertType[i] === "number") { + message.serverCertType[i] = object.serverCertType[i]; + break; + } + case "CERT_TYPE_UNSPECIFIED": + case 0: + message.serverCertType[i] = 0; + break; + case "PEM": + case 1: + message.serverCertType[i] = 1; + break; + } + } + if (object.clientCertType) { + if (!Array.isArray(object.clientCertType)) + throw TypeError(".google.cloud.connectors.v1.SslConfigTemplate.clientCertType: array expected"); + message.clientCertType = []; + for (var i = 0; i < object.clientCertType.length; ++i) + switch (object.clientCertType[i]) { + default: + if (typeof object.clientCertType[i] === "number") { + message.clientCertType[i] = object.clientCertType[i]; + break; + } + case "CERT_TYPE_UNSPECIFIED": + case 0: + message.clientCertType[i] = 0; + break; + case "PEM": + case 1: + message.clientCertType[i] = 1; + break; + } + } + if (object.additionalVariables) { + if (!Array.isArray(object.additionalVariables)) + throw TypeError(".google.cloud.connectors.v1.SslConfigTemplate.additionalVariables: array expected"); + message.additionalVariables = []; + for (var i = 0; i < object.additionalVariables.length; ++i) { + if (typeof object.additionalVariables[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfigTemplate.additionalVariables: object expected"); + message.additionalVariables[i] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.fromObject(object.additionalVariables[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SslConfigTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {google.cloud.connectors.v1.SslConfigTemplate} message SslConfigTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslConfigTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.serverCertType = []; + object.clientCertType = []; + object.additionalVariables = []; + } + if (options.defaults) { + object.sslType = options.enums === String ? "SSL_TYPE_UNSPECIFIED" : 0; + object.isTlsMandatory = false; + } + if (message.sslType != null && message.hasOwnProperty("sslType")) + object.sslType = options.enums === String ? $root.google.cloud.connectors.v1.SslType[message.sslType] === undefined ? message.sslType : $root.google.cloud.connectors.v1.SslType[message.sslType] : message.sslType; + if (message.isTlsMandatory != null && message.hasOwnProperty("isTlsMandatory")) + object.isTlsMandatory = message.isTlsMandatory; + if (message.serverCertType && message.serverCertType.length) { + object.serverCertType = []; + for (var j = 0; j < message.serverCertType.length; ++j) + object.serverCertType[j] = options.enums === String ? $root.google.cloud.connectors.v1.CertType[message.serverCertType[j]] === undefined ? message.serverCertType[j] : $root.google.cloud.connectors.v1.CertType[message.serverCertType[j]] : message.serverCertType[j]; + } + if (message.clientCertType && message.clientCertType.length) { + object.clientCertType = []; + for (var j = 0; j < message.clientCertType.length; ++j) + object.clientCertType[j] = options.enums === String ? $root.google.cloud.connectors.v1.CertType[message.clientCertType[j]] === undefined ? message.clientCertType[j] : $root.google.cloud.connectors.v1.CertType[message.clientCertType[j]] : message.clientCertType[j]; + } + if (message.additionalVariables && message.additionalVariables.length) { + object.additionalVariables = []; + for (var j = 0; j < message.additionalVariables.length; ++j) + object.additionalVariables[j] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.toObject(message.additionalVariables[j], options); + } + return object; + }; + + /** + * Converts this SslConfigTemplate to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + * @returns {Object.} JSON object + */ + SslConfigTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SslConfigTemplate + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SslConfigTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.SslConfigTemplate"; + }; + + return SslConfigTemplate; + })(); + + v1.SslConfig = (function() { + + /** + * Properties of a SslConfig. + * @memberof google.cloud.connectors.v1 + * @interface ISslConfig + * @property {google.cloud.connectors.v1.SslType|null} [type] SslConfig type + * @property {google.cloud.connectors.v1.SslConfig.TrustModel|null} [trustModel] SslConfig trustModel + * @property {google.cloud.connectors.v1.ISecret|null} [privateServerCertificate] SslConfig privateServerCertificate + * @property {google.cloud.connectors.v1.ISecret|null} [clientCertificate] SslConfig clientCertificate + * @property {google.cloud.connectors.v1.ISecret|null} [clientPrivateKey] SslConfig clientPrivateKey + * @property {google.cloud.connectors.v1.ISecret|null} [clientPrivateKeyPass] SslConfig clientPrivateKeyPass + * @property {google.cloud.connectors.v1.CertType|null} [serverCertType] SslConfig serverCertType + * @property {google.cloud.connectors.v1.CertType|null} [clientCertType] SslConfig clientCertType + * @property {boolean|null} [useSsl] SslConfig useSsl + * @property {Array.|null} [additionalVariables] SslConfig additionalVariables + */ + + /** + * Constructs a new SslConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a SslConfig. + * @implements ISslConfig + * @constructor + * @param {google.cloud.connectors.v1.ISslConfig=} [properties] Properties to set + */ + function SslConfig(properties) { + this.additionalVariables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslConfig type. + * @member {google.cloud.connectors.v1.SslType} type + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.type = 0; + + /** + * SslConfig trustModel. + * @member {google.cloud.connectors.v1.SslConfig.TrustModel} trustModel + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.trustModel = 0; + + /** + * SslConfig privateServerCertificate. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} privateServerCertificate + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.privateServerCertificate = null; + + /** + * SslConfig clientCertificate. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} clientCertificate + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientCertificate = null; + + /** + * SslConfig clientPrivateKey. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} clientPrivateKey + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientPrivateKey = null; + + /** + * SslConfig clientPrivateKeyPass. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} clientPrivateKeyPass + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientPrivateKeyPass = null; + + /** + * SslConfig serverCertType. + * @member {google.cloud.connectors.v1.CertType} serverCertType + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.serverCertType = 0; + + /** + * SslConfig clientCertType. + * @member {google.cloud.connectors.v1.CertType} clientCertType + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientCertType = 0; + + /** + * SslConfig useSsl. + * @member {boolean} useSsl + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.useSsl = false; + + /** + * SslConfig additionalVariables. + * @member {Array.} additionalVariables + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.additionalVariables = $util.emptyArray; + + /** + * Creates a new SslConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {google.cloud.connectors.v1.ISslConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.SslConfig} SslConfig instance + */ + SslConfig.create = function create(properties) { + return new SslConfig(properties); + }; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.connectors.v1.SslConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {google.cloud.connectors.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.trustModel != null && Object.hasOwnProperty.call(message, "trustModel")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.trustModel); + if (message.privateServerCertificate != null && Object.hasOwnProperty.call(message, "privateServerCertificate")) + $root.google.cloud.connectors.v1.Secret.encode(message.privateServerCertificate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) + $root.google.cloud.connectors.v1.Secret.encode(message.clientCertificate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientPrivateKey != null && Object.hasOwnProperty.call(message, "clientPrivateKey")) + $root.google.cloud.connectors.v1.Secret.encode(message.clientPrivateKey, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.clientPrivateKeyPass != null && Object.hasOwnProperty.call(message, "clientPrivateKeyPass")) + $root.google.cloud.connectors.v1.Secret.encode(message.clientPrivateKeyPass, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.serverCertType != null && Object.hasOwnProperty.call(message, "serverCertType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.serverCertType); + if (message.clientCertType != null && Object.hasOwnProperty.call(message, "clientCertType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.clientCertType); + if (message.useSsl != null && Object.hasOwnProperty.call(message, "useSsl")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.useSsl); + if (message.additionalVariables != null && message.additionalVariables.length) + for (var i = 0; i < message.additionalVariables.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariable.encode(message.additionalVariables[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SslConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {google.cloud.connectors.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decode = function 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.connectors.v1.SslConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.trustModel = reader.int32(); + break; + } + case 3: { + message.privateServerCertificate = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 4: { + message.clientCertificate = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientPrivateKey = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 6: { + message.clientPrivateKeyPass = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 7: { + message.serverCertType = reader.int32(); + break; + } + case 8: { + message.clientCertType = reader.int32(); + break; + } + case 9: { + message.useSsl = reader.bool(); + break; + } + case 10: { + if (!(message.additionalVariables && message.additionalVariables.length)) + message.additionalVariables = []; + message.additionalVariables.push($root.google.cloud.connectors.v1.ConfigVariable.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.trustModel != null && message.hasOwnProperty("trustModel")) + switch (message.trustModel) { + default: + return "trustModel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.privateServerCertificate != null && message.hasOwnProperty("privateServerCertificate")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.privateServerCertificate); + if (error) + return "privateServerCertificate." + error; + } + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.clientCertificate); + if (error) + return "clientCertificate." + error; + } + if (message.clientPrivateKey != null && message.hasOwnProperty("clientPrivateKey")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.clientPrivateKey); + if (error) + return "clientPrivateKey." + error; + } + if (message.clientPrivateKeyPass != null && message.hasOwnProperty("clientPrivateKeyPass")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.clientPrivateKeyPass); + if (error) + return "clientPrivateKeyPass." + error; + } + if (message.serverCertType != null && message.hasOwnProperty("serverCertType")) + switch (message.serverCertType) { + default: + return "serverCertType: enum value expected"; + case 0: + case 1: + break; + } + if (message.clientCertType != null && message.hasOwnProperty("clientCertType")) + switch (message.clientCertType) { + default: + return "clientCertType: enum value expected"; + case 0: + case 1: + break; + } + if (message.useSsl != null && message.hasOwnProperty("useSsl")) + if (typeof message.useSsl !== "boolean") + return "useSsl: boolean expected"; + if (message.additionalVariables != null && message.hasOwnProperty("additionalVariables")) { + if (!Array.isArray(message.additionalVariables)) + return "additionalVariables: array expected"; + for (var i = 0; i < message.additionalVariables.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariable.verify(message.additionalVariables[i]); + if (error) + return "additionalVariables." + error; + } + } + return null; + }; + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.SslConfig} SslConfig + */ + SslConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.SslConfig) + return object; + var message = new $root.google.cloud.connectors.v1.SslConfig(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "SSL_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TLS": + case 1: + message.type = 1; + break; + case "MTLS": + case 2: + message.type = 2; + break; + } + switch (object.trustModel) { + default: + if (typeof object.trustModel === "number") { + message.trustModel = object.trustModel; + break; + } + break; + case "PUBLIC": + case 0: + message.trustModel = 0; + break; + case "PRIVATE": + case 1: + message.trustModel = 1; + break; + case "INSECURE": + case 2: + message.trustModel = 2; + break; + } + if (object.privateServerCertificate != null) { + if (typeof object.privateServerCertificate !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfig.privateServerCertificate: object expected"); + message.privateServerCertificate = $root.google.cloud.connectors.v1.Secret.fromObject(object.privateServerCertificate); + } + if (object.clientCertificate != null) { + if (typeof object.clientCertificate !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfig.clientCertificate: object expected"); + message.clientCertificate = $root.google.cloud.connectors.v1.Secret.fromObject(object.clientCertificate); + } + if (object.clientPrivateKey != null) { + if (typeof object.clientPrivateKey !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfig.clientPrivateKey: object expected"); + message.clientPrivateKey = $root.google.cloud.connectors.v1.Secret.fromObject(object.clientPrivateKey); + } + if (object.clientPrivateKeyPass != null) { + if (typeof object.clientPrivateKeyPass !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfig.clientPrivateKeyPass: object expected"); + message.clientPrivateKeyPass = $root.google.cloud.connectors.v1.Secret.fromObject(object.clientPrivateKeyPass); + } + switch (object.serverCertType) { + default: + if (typeof object.serverCertType === "number") { + message.serverCertType = object.serverCertType; + break; + } + break; + case "CERT_TYPE_UNSPECIFIED": + case 0: + message.serverCertType = 0; + break; + case "PEM": + case 1: + message.serverCertType = 1; + break; + } + switch (object.clientCertType) { + default: + if (typeof object.clientCertType === "number") { + message.clientCertType = object.clientCertType; + break; + } + break; + case "CERT_TYPE_UNSPECIFIED": + case 0: + message.clientCertType = 0; + break; + case "PEM": + case 1: + message.clientCertType = 1; + break; + } + if (object.useSsl != null) + message.useSsl = Boolean(object.useSsl); + if (object.additionalVariables) { + if (!Array.isArray(object.additionalVariables)) + throw TypeError(".google.cloud.connectors.v1.SslConfig.additionalVariables: array expected"); + message.additionalVariables = []; + for (var i = 0; i < object.additionalVariables.length; ++i) { + if (typeof object.additionalVariables[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfig.additionalVariables: object expected"); + message.additionalVariables[i] = $root.google.cloud.connectors.v1.ConfigVariable.fromObject(object.additionalVariables[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {google.cloud.connectors.v1.SslConfig} message SslConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalVariables = []; + if (options.defaults) { + object.type = options.enums === String ? "SSL_TYPE_UNSPECIFIED" : 0; + object.trustModel = options.enums === String ? "PUBLIC" : 0; + object.privateServerCertificate = null; + object.clientCertificate = null; + object.clientPrivateKey = null; + object.clientPrivateKeyPass = null; + object.serverCertType = options.enums === String ? "CERT_TYPE_UNSPECIFIED" : 0; + object.clientCertType = options.enums === String ? "CERT_TYPE_UNSPECIFIED" : 0; + object.useSsl = false; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.connectors.v1.SslType[message.type] === undefined ? message.type : $root.google.cloud.connectors.v1.SslType[message.type] : message.type; + if (message.trustModel != null && message.hasOwnProperty("trustModel")) + object.trustModel = options.enums === String ? $root.google.cloud.connectors.v1.SslConfig.TrustModel[message.trustModel] === undefined ? message.trustModel : $root.google.cloud.connectors.v1.SslConfig.TrustModel[message.trustModel] : message.trustModel; + if (message.privateServerCertificate != null && message.hasOwnProperty("privateServerCertificate")) + object.privateServerCertificate = $root.google.cloud.connectors.v1.Secret.toObject(message.privateServerCertificate, options); + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + object.clientCertificate = $root.google.cloud.connectors.v1.Secret.toObject(message.clientCertificate, options); + if (message.clientPrivateKey != null && message.hasOwnProperty("clientPrivateKey")) + object.clientPrivateKey = $root.google.cloud.connectors.v1.Secret.toObject(message.clientPrivateKey, options); + if (message.clientPrivateKeyPass != null && message.hasOwnProperty("clientPrivateKeyPass")) + object.clientPrivateKeyPass = $root.google.cloud.connectors.v1.Secret.toObject(message.clientPrivateKeyPass, options); + if (message.serverCertType != null && message.hasOwnProperty("serverCertType")) + object.serverCertType = options.enums === String ? $root.google.cloud.connectors.v1.CertType[message.serverCertType] === undefined ? message.serverCertType : $root.google.cloud.connectors.v1.CertType[message.serverCertType] : message.serverCertType; + if (message.clientCertType != null && message.hasOwnProperty("clientCertType")) + object.clientCertType = options.enums === String ? $root.google.cloud.connectors.v1.CertType[message.clientCertType] === undefined ? message.clientCertType : $root.google.cloud.connectors.v1.CertType[message.clientCertType] : message.clientCertType; + if (message.useSsl != null && message.hasOwnProperty("useSsl")) + object.useSsl = message.useSsl; + if (message.additionalVariables && message.additionalVariables.length) { + object.additionalVariables = []; + for (var j = 0; j < message.additionalVariables.length; ++j) + object.additionalVariables[j] = $root.google.cloud.connectors.v1.ConfigVariable.toObject(message.additionalVariables[j], options); + } + return object; + }; + + /** + * Converts this SslConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + * @returns {Object.} JSON object + */ + SslConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SslConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.SslConfig"; + }; + + /** + * TrustModel enum. + * @name google.cloud.connectors.v1.SslConfig.TrustModel + * @enum {number} + * @property {number} PUBLIC=0 PUBLIC value + * @property {number} PRIVATE=1 PRIVATE value + * @property {number} INSECURE=2 INSECURE value + */ + SslConfig.TrustModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PUBLIC"] = 0; + values[valuesById[1] = "PRIVATE"] = 1; + values[valuesById[2] = "INSECURE"] = 2; + return values; + })(); + + return SslConfig; + })(); + + /** + * SslType enum. + * @name google.cloud.connectors.v1.SslType + * @enum {number} + * @property {number} SSL_TYPE_UNSPECIFIED=0 SSL_TYPE_UNSPECIFIED value + * @property {number} TLS=1 TLS value + * @property {number} MTLS=2 MTLS value + */ + v1.SslType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TLS"] = 1; + values[valuesById[2] = "MTLS"] = 2; + return values; + })(); + + /** + * CertType enum. + * @name google.cloud.connectors.v1.CertType + * @enum {number} + * @property {number} CERT_TYPE_UNSPECIFIED=0 CERT_TYPE_UNSPECIFIED value + * @property {number} PEM=1 PEM value + */ + v1.CertType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CERT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PEM"] = 1; + return values; + })(); + + v1.Connector = (function() { + + /** + * Properties of a Connector. + * @memberof google.cloud.connectors.v1 + * @interface IConnector + * @property {string|null} [name] Connector name + * @property {google.protobuf.ITimestamp|null} [createTime] Connector createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Connector updateTime + * @property {Object.|null} [labels] Connector labels + * @property {string|null} [documentationUri] Connector documentationUri + * @property {string|null} [externalUri] Connector externalUri + * @property {string|null} [description] Connector description + * @property {string|null} [webAssetsLocation] Connector webAssetsLocation + * @property {string|null} [displayName] Connector displayName + * @property {google.cloud.connectors.v1.LaunchStage|null} [launchStage] Connector launchStage + */ + + /** + * Constructs a new Connector. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Connector. + * @implements IConnector + * @constructor + * @param {google.cloud.connectors.v1.IConnector=} [properties] Properties to set + */ + function Connector(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Connector name. + * @member {string} name + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.name = ""; + + /** + * Connector createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.createTime = null; + + /** + * Connector updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.updateTime = null; + + /** + * Connector labels. + * @member {Object.} labels + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.labels = $util.emptyObject; + + /** + * Connector documentationUri. + * @member {string} documentationUri + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.documentationUri = ""; + + /** + * Connector externalUri. + * @member {string} externalUri + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.externalUri = ""; + + /** + * Connector description. + * @member {string} description + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.description = ""; + + /** + * Connector webAssetsLocation. + * @member {string} webAssetsLocation + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.webAssetsLocation = ""; + + /** + * Connector displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.displayName = ""; + + /** + * Connector launchStage. + * @member {google.cloud.connectors.v1.LaunchStage} launchStage + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.launchStage = 0; + + /** + * Creates a new Connector instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {google.cloud.connectors.v1.IConnector=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Connector} Connector instance + */ + Connector.create = function create(properties) { + return new Connector(properties); + }; + + /** + * Encodes the specified Connector message. Does not implicitly {@link google.cloud.connectors.v1.Connector.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {google.cloud.connectors.v1.IConnector} message Connector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.documentationUri); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.externalUri); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + if (message.webAssetsLocation != null && Object.hasOwnProperty.call(message, "webAssetsLocation")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.webAssetsLocation); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.launchStage); + return writer; + }; + + /** + * Encodes the specified Connector message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Connector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {google.cloud.connectors.v1.IConnector} message Connector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Connector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Connector} Connector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connector.decode = function 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.connectors.v1.Connector(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.documentationUri = reader.string(); + break; + } + case 7: { + message.externalUri = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 9: { + message.webAssetsLocation = reader.string(); + break; + } + case 10: { + message.displayName = reader.string(); + break; + } + case 11: { + message.launchStage = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Connector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Connector} Connector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Connector message. + * @function verify + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Connector.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.webAssetsLocation != null && message.hasOwnProperty("webAssetsLocation")) + if (!$util.isString(message.webAssetsLocation)) + return "webAssetsLocation: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + return null; + }; + + /** + * Creates a Connector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Connector} Connector + */ + Connector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Connector) + return object; + var message = new $root.google.cloud.connectors.v1.Connector(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.connectors.v1.Connector.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.connectors.v1.Connector.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.connectors.v1.Connector.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.description != null) + message.description = String(object.description); + if (object.webAssetsLocation != null) + message.webAssetsLocation = String(object.webAssetsLocation); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "PREVIEW": + case 1: + message.launchStage = 1; + break; + case "GA": + case 2: + message.launchStage = 2; + break; + case "DEPRECATED": + case 3: + message.launchStage = 3; + break; + case "PRIVATE_PREVIEW": + case 5: + message.launchStage = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a Connector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {google.cloud.connectors.v1.Connector} message Connector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Connector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.documentationUri = ""; + object.externalUri = ""; + object.description = ""; + object.webAssetsLocation = ""; + object.displayName = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.webAssetsLocation != null && message.hasOwnProperty("webAssetsLocation")) + object.webAssetsLocation = message.webAssetsLocation; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] : message.launchStage; + return object; + }; + + /** + * Converts this Connector to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Connector + * @instance + * @returns {Object.} JSON object + */ + Connector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Connector + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Connector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Connector"; + }; + + return Connector; + })(); + + v1.GetConnectorRequest = (function() { + + /** + * Properties of a GetConnectorRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetConnectorRequest + * @property {string|null} [name] GetConnectorRequest name + */ + + /** + * Constructs a new GetConnectorRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetConnectorRequest. + * @implements IGetConnectorRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetConnectorRequest=} [properties] Properties to set + */ + function GetConnectorRequest(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]]; + } + + /** + * GetConnectorRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @instance + */ + GetConnectorRequest.prototype.name = ""; + + /** + * Creates a new GetConnectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetConnectorRequest} GetConnectorRequest instance + */ + GetConnectorRequest.create = function create(properties) { + return new GetConnectorRequest(properties); + }; + + /** + * Encodes the specified GetConnectorRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorRequest} message GetConnectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetConnectorRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorRequest} message GetConnectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetConnectorRequest} GetConnectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectorRequest.decode = function 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.connectors.v1.GetConnectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConnectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetConnectorRequest} GetConnectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectorRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectorRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetConnectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetConnectorRequest} GetConnectorRequest + */ + GetConnectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetConnectorRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetConnectorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetConnectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {google.cloud.connectors.v1.GetConnectorRequest} message GetConnectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetConnectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectorRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetConnectorRequest"; + }; + + return GetConnectorRequest; + })(); + + v1.ListConnectorsRequest = (function() { + + /** + * Properties of a ListConnectorsRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectorsRequest + * @property {string|null} [parent] ListConnectorsRequest parent + * @property {number|null} [pageSize] ListConnectorsRequest pageSize + * @property {string|null} [pageToken] ListConnectorsRequest pageToken + */ + + /** + * Constructs a new ListConnectorsRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectorsRequest. + * @implements IListConnectorsRequest + * @constructor + * @param {google.cloud.connectors.v1.IListConnectorsRequest=} [properties] Properties to set + */ + function ListConnectorsRequest(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]]; + } + + /** + * ListConnectorsRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @instance + */ + ListConnectorsRequest.prototype.parent = ""; + + /** + * ListConnectorsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @instance + */ + ListConnectorsRequest.prototype.pageSize = 0; + + /** + * ListConnectorsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @instance + */ + ListConnectorsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListConnectorsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorsRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectorsRequest} ListConnectorsRequest instance + */ + ListConnectorsRequest.create = function create(properties) { + return new ListConnectorsRequest(properties); + }; + + /** + * Encodes the specified ListConnectorsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorsRequest} message ListConnectorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListConnectorsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorsRequest} message ListConnectorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectorsRequest} ListConnectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorsRequest.decode = function 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.connectors.v1.ListConnectorsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectorsRequest} ListConnectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectorsRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectorsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListConnectorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectorsRequest} ListConnectorsRequest + */ + ListConnectorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectorsRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectorsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListConnectorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {google.cloud.connectors.v1.ListConnectorsRequest} message ListConnectorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectorsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListConnectorsRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListConnectorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectorsRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectorsRequest"; + }; + + return ListConnectorsRequest; + })(); + + v1.ListConnectorsResponse = (function() { + + /** + * Properties of a ListConnectorsResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectorsResponse + * @property {Array.|null} [connectors] ListConnectorsResponse connectors + * @property {string|null} [nextPageToken] ListConnectorsResponse nextPageToken + * @property {Array.|null} [unreachable] ListConnectorsResponse unreachable + */ + + /** + * Constructs a new ListConnectorsResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectorsResponse. + * @implements IListConnectorsResponse + * @constructor + * @param {google.cloud.connectors.v1.IListConnectorsResponse=} [properties] Properties to set + */ + function ListConnectorsResponse(properties) { + this.connectors = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConnectorsResponse connectors. + * @member {Array.} connectors + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @instance + */ + ListConnectorsResponse.prototype.connectors = $util.emptyArray; + + /** + * ListConnectorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @instance + */ + ListConnectorsResponse.prototype.nextPageToken = ""; + + /** + * ListConnectorsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @instance + */ + ListConnectorsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListConnectorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorsResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectorsResponse} ListConnectorsResponse instance + */ + ListConnectorsResponse.create = function create(properties) { + return new ListConnectorsResponse(properties); + }; + + /** + * Encodes the specified ListConnectorsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorsResponse} message ListConnectorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectors != null && message.connectors.length) + for (var i = 0; i < message.connectors.length; ++i) + $root.google.cloud.connectors.v1.Connector.encode(message.connectors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListConnectorsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorsResponse} message ListConnectorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectorsResponse} ListConnectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorsResponse.decode = function 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.connectors.v1.ListConnectorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.connectors && message.connectors.length)) + message.connectors = []; + message.connectors.push($root.google.cloud.connectors.v1.Connector.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectorsResponse} ListConnectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectorsResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectors != null && message.hasOwnProperty("connectors")) { + if (!Array.isArray(message.connectors)) + return "connectors: array expected"; + for (var i = 0; i < message.connectors.length; ++i) { + var error = $root.google.cloud.connectors.v1.Connector.verify(message.connectors[i]); + if (error) + return "connectors." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListConnectorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectorsResponse} ListConnectorsResponse + */ + ListConnectorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectorsResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectorsResponse(); + if (object.connectors) { + if (!Array.isArray(object.connectors)) + throw TypeError(".google.cloud.connectors.v1.ListConnectorsResponse.connectors: array expected"); + message.connectors = []; + for (var i = 0; i < object.connectors.length; ++i) { + if (typeof object.connectors[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListConnectorsResponse.connectors: object expected"); + message.connectors[i] = $root.google.cloud.connectors.v1.Connector.fromObject(object.connectors[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.connectors.v1.ListConnectorsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListConnectorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {google.cloud.connectors.v1.ListConnectorsResponse} message ListConnectorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.connectors = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.connectors && message.connectors.length) { + object.connectors = []; + for (var j = 0; j < message.connectors.length; ++j) + object.connectors[j] = $root.google.cloud.connectors.v1.Connector.toObject(message.connectors[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListConnectorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListConnectorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectorsResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectorsResponse"; + }; + + return ListConnectorsResponse; + })(); + + v1.ConnectorVersion = (function() { + + /** + * Properties of a ConnectorVersion. + * @memberof google.cloud.connectors.v1 + * @interface IConnectorVersion + * @property {string|null} [name] ConnectorVersion name + * @property {google.protobuf.ITimestamp|null} [createTime] ConnectorVersion createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ConnectorVersion updateTime + * @property {Object.|null} [labels] ConnectorVersion labels + * @property {google.cloud.connectors.v1.LaunchStage|null} [launchStage] ConnectorVersion launchStage + * @property {string|null} [releaseVersion] ConnectorVersion releaseVersion + * @property {Array.|null} [authConfigTemplates] ConnectorVersion authConfigTemplates + * @property {Array.|null} [configVariableTemplates] ConnectorVersion configVariableTemplates + * @property {google.cloud.connectors.v1.ISupportedRuntimeFeatures|null} [supportedRuntimeFeatures] ConnectorVersion supportedRuntimeFeatures + * @property {string|null} [displayName] ConnectorVersion displayName + * @property {google.cloud.connectors.v1.IEgressControlConfig|null} [egressControlConfig] ConnectorVersion egressControlConfig + * @property {Array.|null} [roleGrants] ConnectorVersion roleGrants + * @property {google.cloud.connectors.v1.IRoleGrant|null} [roleGrant] ConnectorVersion roleGrant + * @property {google.cloud.connectors.v1.ISslConfigTemplate|null} [sslConfigTemplate] ConnectorVersion sslConfigTemplate + */ + + /** + * Constructs a new ConnectorVersion. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ConnectorVersion. + * @implements IConnectorVersion + * @constructor + * @param {google.cloud.connectors.v1.IConnectorVersion=} [properties] Properties to set + */ + function ConnectorVersion(properties) { + this.labels = {}; + this.authConfigTemplates = []; + this.configVariableTemplates = []; + this.roleGrants = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorVersion name. + * @member {string} name + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.name = ""; + + /** + * ConnectorVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.createTime = null; + + /** + * ConnectorVersion updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.updateTime = null; + + /** + * ConnectorVersion labels. + * @member {Object.} labels + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.labels = $util.emptyObject; + + /** + * ConnectorVersion launchStage. + * @member {google.cloud.connectors.v1.LaunchStage} launchStage + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.launchStage = 0; + + /** + * ConnectorVersion releaseVersion. + * @member {string} releaseVersion + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.releaseVersion = ""; + + /** + * ConnectorVersion authConfigTemplates. + * @member {Array.} authConfigTemplates + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.authConfigTemplates = $util.emptyArray; + + /** + * ConnectorVersion configVariableTemplates. + * @member {Array.} configVariableTemplates + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.configVariableTemplates = $util.emptyArray; + + /** + * ConnectorVersion supportedRuntimeFeatures. + * @member {google.cloud.connectors.v1.ISupportedRuntimeFeatures|null|undefined} supportedRuntimeFeatures + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.supportedRuntimeFeatures = null; + + /** + * ConnectorVersion displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.displayName = ""; + + /** + * ConnectorVersion egressControlConfig. + * @member {google.cloud.connectors.v1.IEgressControlConfig|null|undefined} egressControlConfig + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.egressControlConfig = null; + + /** + * ConnectorVersion roleGrants. + * @member {Array.} roleGrants + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.roleGrants = $util.emptyArray; + + /** + * ConnectorVersion roleGrant. + * @member {google.cloud.connectors.v1.IRoleGrant|null|undefined} roleGrant + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.roleGrant = null; + + /** + * ConnectorVersion sslConfigTemplate. + * @member {google.cloud.connectors.v1.ISslConfigTemplate|null|undefined} sslConfigTemplate + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.sslConfigTemplate = null; + + /** + * Creates a new ConnectorVersion instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {google.cloud.connectors.v1.IConnectorVersion=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ConnectorVersion} ConnectorVersion instance + */ + ConnectorVersion.create = function create(properties) { + return new ConnectorVersion(properties); + }; + + /** + * Encodes the specified ConnectorVersion message. Does not implicitly {@link google.cloud.connectors.v1.ConnectorVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {google.cloud.connectors.v1.IConnectorVersion} message ConnectorVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.launchStage); + if (message.releaseVersion != null && Object.hasOwnProperty.call(message, "releaseVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.releaseVersion); + if (message.authConfigTemplates != null && message.authConfigTemplates.length) + for (var i = 0; i < message.authConfigTemplates.length; ++i) + $root.google.cloud.connectors.v1.AuthConfigTemplate.encode(message.authConfigTemplates[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.configVariableTemplates != null && message.configVariableTemplates.length) + for (var i = 0; i < message.configVariableTemplates.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariableTemplate.encode(message.configVariableTemplates[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.supportedRuntimeFeatures != null && Object.hasOwnProperty.call(message, "supportedRuntimeFeatures")) + $root.google.cloud.connectors.v1.SupportedRuntimeFeatures.encode(message.supportedRuntimeFeatures, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.displayName); + if (message.egressControlConfig != null && Object.hasOwnProperty.call(message, "egressControlConfig")) + $root.google.cloud.connectors.v1.EgressControlConfig.encode(message.egressControlConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.roleGrants != null && message.roleGrants.length) + for (var i = 0; i < message.roleGrants.length; ++i) + $root.google.cloud.connectors.v1.RoleGrant.encode(message.roleGrants[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.roleGrant != null && Object.hasOwnProperty.call(message, "roleGrant")) + $root.google.cloud.connectors.v1.RoleGrant.encode(message.roleGrant, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.sslConfigTemplate != null && Object.hasOwnProperty.call(message, "sslConfigTemplate")) + $root.google.cloud.connectors.v1.SslConfigTemplate.encode(message.sslConfigTemplate, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConnectorVersion message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectorVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {google.cloud.connectors.v1.IConnectorVersion} message ConnectorVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ConnectorVersion} ConnectorVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorVersion.decode = function 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.connectors.v1.ConnectorVersion(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.launchStage = reader.int32(); + break; + } + case 7: { + message.releaseVersion = reader.string(); + break; + } + case 8: { + if (!(message.authConfigTemplates && message.authConfigTemplates.length)) + message.authConfigTemplates = []; + message.authConfigTemplates.push($root.google.cloud.connectors.v1.AuthConfigTemplate.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.configVariableTemplates && message.configVariableTemplates.length)) + message.configVariableTemplates = []; + message.configVariableTemplates.push($root.google.cloud.connectors.v1.ConfigVariableTemplate.decode(reader, reader.uint32())); + break; + } + case 10: { + message.supportedRuntimeFeatures = $root.google.cloud.connectors.v1.SupportedRuntimeFeatures.decode(reader, reader.uint32()); + break; + } + case 11: { + message.displayName = reader.string(); + break; + } + case 12: { + message.egressControlConfig = $root.google.cloud.connectors.v1.EgressControlConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.roleGrants && message.roleGrants.length)) + message.roleGrants = []; + message.roleGrants.push($root.google.cloud.connectors.v1.RoleGrant.decode(reader, reader.uint32())); + break; + } + case 15: { + message.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.decode(reader, reader.uint32()); + break; + } + case 17: { + message.sslConfigTemplate = $root.google.cloud.connectors.v1.SslConfigTemplate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ConnectorVersion} ConnectorVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorVersion message. + * @function verify + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorVersion.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + if (message.releaseVersion != null && message.hasOwnProperty("releaseVersion")) + if (!$util.isString(message.releaseVersion)) + return "releaseVersion: string expected"; + if (message.authConfigTemplates != null && message.hasOwnProperty("authConfigTemplates")) { + if (!Array.isArray(message.authConfigTemplates)) + return "authConfigTemplates: array expected"; + for (var i = 0; i < message.authConfigTemplates.length; ++i) { + var error = $root.google.cloud.connectors.v1.AuthConfigTemplate.verify(message.authConfigTemplates[i]); + if (error) + return "authConfigTemplates." + error; + } + } + if (message.configVariableTemplates != null && message.hasOwnProperty("configVariableTemplates")) { + if (!Array.isArray(message.configVariableTemplates)) + return "configVariableTemplates: array expected"; + for (var i = 0; i < message.configVariableTemplates.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariableTemplate.verify(message.configVariableTemplates[i]); + if (error) + return "configVariableTemplates." + error; + } + } + if (message.supportedRuntimeFeatures != null && message.hasOwnProperty("supportedRuntimeFeatures")) { + var error = $root.google.cloud.connectors.v1.SupportedRuntimeFeatures.verify(message.supportedRuntimeFeatures); + if (error) + return "supportedRuntimeFeatures." + error; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.egressControlConfig != null && message.hasOwnProperty("egressControlConfig")) { + var error = $root.google.cloud.connectors.v1.EgressControlConfig.verify(message.egressControlConfig); + if (error) + return "egressControlConfig." + error; + } + if (message.roleGrants != null && message.hasOwnProperty("roleGrants")) { + if (!Array.isArray(message.roleGrants)) + return "roleGrants: array expected"; + for (var i = 0; i < message.roleGrants.length; ++i) { + var error = $root.google.cloud.connectors.v1.RoleGrant.verify(message.roleGrants[i]); + if (error) + return "roleGrants." + error; + } + } + if (message.roleGrant != null && message.hasOwnProperty("roleGrant")) { + var error = $root.google.cloud.connectors.v1.RoleGrant.verify(message.roleGrant); + if (error) + return "roleGrant." + error; + } + if (message.sslConfigTemplate != null && message.hasOwnProperty("sslConfigTemplate")) { + var error = $root.google.cloud.connectors.v1.SslConfigTemplate.verify(message.sslConfigTemplate); + if (error) + return "sslConfigTemplate." + error; + } + return null; + }; + + /** + * Creates a ConnectorVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ConnectorVersion} ConnectorVersion + */ + ConnectorVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ConnectorVersion) + return object; + var message = new $root.google.cloud.connectors.v1.ConnectorVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "PREVIEW": + case 1: + message.launchStage = 1; + break; + case "GA": + case 2: + message.launchStage = 2; + break; + case "DEPRECATED": + case 3: + message.launchStage = 3; + break; + case "PRIVATE_PREVIEW": + case 5: + message.launchStage = 5; + break; + } + if (object.releaseVersion != null) + message.releaseVersion = String(object.releaseVersion); + if (object.authConfigTemplates) { + if (!Array.isArray(object.authConfigTemplates)) + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.authConfigTemplates: array expected"); + message.authConfigTemplates = []; + for (var i = 0; i < object.authConfigTemplates.length; ++i) { + if (typeof object.authConfigTemplates[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.authConfigTemplates: object expected"); + message.authConfigTemplates[i] = $root.google.cloud.connectors.v1.AuthConfigTemplate.fromObject(object.authConfigTemplates[i]); + } + } + if (object.configVariableTemplates) { + if (!Array.isArray(object.configVariableTemplates)) + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.configVariableTemplates: array expected"); + message.configVariableTemplates = []; + for (var i = 0; i < object.configVariableTemplates.length; ++i) { + if (typeof object.configVariableTemplates[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.configVariableTemplates: object expected"); + message.configVariableTemplates[i] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.fromObject(object.configVariableTemplates[i]); + } + } + if (object.supportedRuntimeFeatures != null) { + if (typeof object.supportedRuntimeFeatures !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.supportedRuntimeFeatures: object expected"); + message.supportedRuntimeFeatures = $root.google.cloud.connectors.v1.SupportedRuntimeFeatures.fromObject(object.supportedRuntimeFeatures); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.egressControlConfig != null) { + if (typeof object.egressControlConfig !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.egressControlConfig: object expected"); + message.egressControlConfig = $root.google.cloud.connectors.v1.EgressControlConfig.fromObject(object.egressControlConfig); + } + if (object.roleGrants) { + if (!Array.isArray(object.roleGrants)) + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.roleGrants: array expected"); + message.roleGrants = []; + for (var i = 0; i < object.roleGrants.length; ++i) { + if (typeof object.roleGrants[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.roleGrants: object expected"); + message.roleGrants[i] = $root.google.cloud.connectors.v1.RoleGrant.fromObject(object.roleGrants[i]); + } + } + if (object.roleGrant != null) { + if (typeof object.roleGrant !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.roleGrant: object expected"); + message.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.fromObject(object.roleGrant); + } + if (object.sslConfigTemplate != null) { + if (typeof object.sslConfigTemplate !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.sslConfigTemplate: object expected"); + message.sslConfigTemplate = $root.google.cloud.connectors.v1.SslConfigTemplate.fromObject(object.sslConfigTemplate); + } + return message; + }; + + /** + * Creates a plain object from a ConnectorVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {google.cloud.connectors.v1.ConnectorVersion} message ConnectorVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.authConfigTemplates = []; + object.configVariableTemplates = []; + object.roleGrants = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.releaseVersion = ""; + object.supportedRuntimeFeatures = null; + object.displayName = ""; + object.egressControlConfig = null; + object.roleGrant = null; + object.sslConfigTemplate = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] : message.launchStage; + if (message.releaseVersion != null && message.hasOwnProperty("releaseVersion")) + object.releaseVersion = message.releaseVersion; + if (message.authConfigTemplates && message.authConfigTemplates.length) { + object.authConfigTemplates = []; + for (var j = 0; j < message.authConfigTemplates.length; ++j) + object.authConfigTemplates[j] = $root.google.cloud.connectors.v1.AuthConfigTemplate.toObject(message.authConfigTemplates[j], options); + } + if (message.configVariableTemplates && message.configVariableTemplates.length) { + object.configVariableTemplates = []; + for (var j = 0; j < message.configVariableTemplates.length; ++j) + object.configVariableTemplates[j] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.toObject(message.configVariableTemplates[j], options); + } + if (message.supportedRuntimeFeatures != null && message.hasOwnProperty("supportedRuntimeFeatures")) + object.supportedRuntimeFeatures = $root.google.cloud.connectors.v1.SupportedRuntimeFeatures.toObject(message.supportedRuntimeFeatures, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.egressControlConfig != null && message.hasOwnProperty("egressControlConfig")) + object.egressControlConfig = $root.google.cloud.connectors.v1.EgressControlConfig.toObject(message.egressControlConfig, options); + if (message.roleGrants && message.roleGrants.length) { + object.roleGrants = []; + for (var j = 0; j < message.roleGrants.length; ++j) + object.roleGrants[j] = $root.google.cloud.connectors.v1.RoleGrant.toObject(message.roleGrants[j], options); + } + if (message.roleGrant != null && message.hasOwnProperty("roleGrant")) + object.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.toObject(message.roleGrant, options); + if (message.sslConfigTemplate != null && message.hasOwnProperty("sslConfigTemplate")) + object.sslConfigTemplate = $root.google.cloud.connectors.v1.SslConfigTemplate.toObject(message.sslConfigTemplate, options); + return object; + }; + + /** + * Converts this ConnectorVersion to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + * @returns {Object.} JSON object + */ + ConnectorVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorVersion + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ConnectorVersion"; + }; + + return ConnectorVersion; + })(); + + v1.GetConnectorVersionRequest = (function() { + + /** + * Properties of a GetConnectorVersionRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetConnectorVersionRequest + * @property {string|null} [name] GetConnectorVersionRequest name + * @property {google.cloud.connectors.v1.ConnectorVersionView|null} [view] GetConnectorVersionRequest view + */ + + /** + * Constructs a new GetConnectorVersionRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetConnectorVersionRequest. + * @implements IGetConnectorVersionRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest=} [properties] Properties to set + */ + function GetConnectorVersionRequest(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]]; + } + + /** + * GetConnectorVersionRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @instance + */ + GetConnectorVersionRequest.prototype.name = ""; + + /** + * GetConnectorVersionRequest view. + * @member {google.cloud.connectors.v1.ConnectorVersionView} view + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @instance + */ + GetConnectorVersionRequest.prototype.view = 0; + + /** + * Creates a new GetConnectorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetConnectorVersionRequest} GetConnectorVersionRequest instance + */ + GetConnectorVersionRequest.create = function create(properties) { + return new GetConnectorVersionRequest(properties); + }; + + /** + * Encodes the specified GetConnectorVersionRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest} message GetConnectorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectorVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetConnectorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest} message GetConnectorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetConnectorVersionRequest} GetConnectorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectorVersionRequest.decode = function 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.connectors.v1.GetConnectorVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConnectorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetConnectorVersionRequest} GetConnectorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectorVersionRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectorVersionRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetConnectorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetConnectorVersionRequest} GetConnectorVersionRequest + */ + GetConnectorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetConnectorVersionRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetConnectorVersionRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CONNECTOR_VERSION_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "CONNECTOR_VERSION_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "CONNECTOR_VERSION_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetConnectorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {google.cloud.connectors.v1.GetConnectorVersionRequest} message GetConnectorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectorVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "CONNECTOR_VERSION_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.connectors.v1.ConnectorVersionView[message.view] === undefined ? message.view : $root.google.cloud.connectors.v1.ConnectorVersionView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetConnectorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetConnectorVersionRequest"; + }; + + return GetConnectorVersionRequest; + })(); + + v1.ListConnectorVersionsRequest = (function() { + + /** + * Properties of a ListConnectorVersionsRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectorVersionsRequest + * @property {string|null} [parent] ListConnectorVersionsRequest parent + * @property {number|null} [pageSize] ListConnectorVersionsRequest pageSize + * @property {string|null} [pageToken] ListConnectorVersionsRequest pageToken + * @property {google.cloud.connectors.v1.ConnectorVersionView|null} [view] ListConnectorVersionsRequest view + */ + + /** + * Constructs a new ListConnectorVersionsRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectorVersionsRequest. + * @implements IListConnectorVersionsRequest + * @constructor + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest=} [properties] Properties to set + */ + function ListConnectorVersionsRequest(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]]; + } + + /** + * ListConnectorVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @instance + */ + ListConnectorVersionsRequest.prototype.parent = ""; + + /** + * ListConnectorVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @instance + */ + ListConnectorVersionsRequest.prototype.pageSize = 0; + + /** + * ListConnectorVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @instance + */ + ListConnectorVersionsRequest.prototype.pageToken = ""; + + /** + * ListConnectorVersionsRequest view. + * @member {google.cloud.connectors.v1.ConnectorVersionView} view + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @instance + */ + ListConnectorVersionsRequest.prototype.view = 0; + + /** + * Creates a new ListConnectorVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectorVersionsRequest} ListConnectorVersionsRequest instance + */ + ListConnectorVersionsRequest.create = function create(properties) { + return new ListConnectorVersionsRequest(properties); + }; + + /** + * Encodes the specified ListConnectorVersionsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest} message ListConnectorVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorVersionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListConnectorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest} message ListConnectorVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectorVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectorVersionsRequest} ListConnectorVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorVersionsRequest.decode = function 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.connectors.v1.ListConnectorVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectorVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectorVersionsRequest} ListConnectorVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectorVersionsRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectorVersionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListConnectorVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectorVersionsRequest} ListConnectorVersionsRequest + */ + ListConnectorVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectorVersionsRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectorVersionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CONNECTOR_VERSION_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "CONNECTOR_VERSION_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "CONNECTOR_VERSION_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListConnectorVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {google.cloud.connectors.v1.ListConnectorVersionsRequest} message ListConnectorVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectorVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "CONNECTOR_VERSION_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.connectors.v1.ConnectorVersionView[message.view] === undefined ? message.view : $root.google.cloud.connectors.v1.ConnectorVersionView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListConnectorVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListConnectorVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectorVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectorVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectorVersionsRequest"; + }; + + return ListConnectorVersionsRequest; + })(); + + v1.ListConnectorVersionsResponse = (function() { + + /** + * Properties of a ListConnectorVersionsResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectorVersionsResponse + * @property {Array.|null} [connectorVersions] ListConnectorVersionsResponse connectorVersions + * @property {string|null} [nextPageToken] ListConnectorVersionsResponse nextPageToken + * @property {Array.|null} [unreachable] ListConnectorVersionsResponse unreachable + */ + + /** + * Constructs a new ListConnectorVersionsResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectorVersionsResponse. + * @implements IListConnectorVersionsResponse + * @constructor + * @param {google.cloud.connectors.v1.IListConnectorVersionsResponse=} [properties] Properties to set + */ + function ListConnectorVersionsResponse(properties) { + this.connectorVersions = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConnectorVersionsResponse connectorVersions. + * @member {Array.} connectorVersions + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @instance + */ + ListConnectorVersionsResponse.prototype.connectorVersions = $util.emptyArray; + + /** + * ListConnectorVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @instance + */ + ListConnectorVersionsResponse.prototype.nextPageToken = ""; + + /** + * ListConnectorVersionsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @instance + */ + ListConnectorVersionsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListConnectorVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectorVersionsResponse} ListConnectorVersionsResponse instance + */ + ListConnectorVersionsResponse.create = function create(properties) { + return new ListConnectorVersionsResponse(properties); + }; + + /** + * Encodes the specified ListConnectorVersionsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsResponse} message ListConnectorVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectorVersions != null && message.connectorVersions.length) + for (var i = 0; i < message.connectorVersions.length; ++i) + $root.google.cloud.connectors.v1.ConnectorVersion.encode(message.connectorVersions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListConnectorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsResponse} message ListConnectorVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectorVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectorVersionsResponse} ListConnectorVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorVersionsResponse.decode = function 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.connectors.v1.ListConnectorVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.connectorVersions && message.connectorVersions.length)) + message.connectorVersions = []; + message.connectorVersions.push($root.google.cloud.connectors.v1.ConnectorVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectorVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectorVersionsResponse} ListConnectorVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectorVersionsResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectorVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectorVersions != null && message.hasOwnProperty("connectorVersions")) { + if (!Array.isArray(message.connectorVersions)) + return "connectorVersions: array expected"; + for (var i = 0; i < message.connectorVersions.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConnectorVersion.verify(message.connectorVersions[i]); + if (error) + return "connectorVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListConnectorVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectorVersionsResponse} ListConnectorVersionsResponse + */ + ListConnectorVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectorVersionsResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectorVersionsResponse(); + if (object.connectorVersions) { + if (!Array.isArray(object.connectorVersions)) + throw TypeError(".google.cloud.connectors.v1.ListConnectorVersionsResponse.connectorVersions: array expected"); + message.connectorVersions = []; + for (var i = 0; i < object.connectorVersions.length; ++i) { + if (typeof object.connectorVersions[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListConnectorVersionsResponse.connectorVersions: object expected"); + message.connectorVersions[i] = $root.google.cloud.connectors.v1.ConnectorVersion.fromObject(object.connectorVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.connectors.v1.ListConnectorVersionsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListConnectorVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {google.cloud.connectors.v1.ListConnectorVersionsResponse} message ListConnectorVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectorVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.connectorVersions = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.connectorVersions && message.connectorVersions.length) { + object.connectorVersions = []; + for (var j = 0; j < message.connectorVersions.length; ++j) + object.connectorVersions[j] = $root.google.cloud.connectors.v1.ConnectorVersion.toObject(message.connectorVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListConnectorVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListConnectorVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectorVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectorVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectorVersionsResponse"; + }; + + return ListConnectorVersionsResponse; + })(); + + v1.SupportedRuntimeFeatures = (function() { + + /** + * Properties of a SupportedRuntimeFeatures. + * @memberof google.cloud.connectors.v1 + * @interface ISupportedRuntimeFeatures + * @property {boolean|null} [entityApis] SupportedRuntimeFeatures entityApis + * @property {boolean|null} [actionApis] SupportedRuntimeFeatures actionApis + * @property {boolean|null} [sqlQuery] SupportedRuntimeFeatures sqlQuery + */ + + /** + * Constructs a new SupportedRuntimeFeatures. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a SupportedRuntimeFeatures. + * @implements ISupportedRuntimeFeatures + * @constructor + * @param {google.cloud.connectors.v1.ISupportedRuntimeFeatures=} [properties] Properties to set + */ + function SupportedRuntimeFeatures(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]]; + } + + /** + * SupportedRuntimeFeatures entityApis. + * @member {boolean} entityApis + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @instance + */ + SupportedRuntimeFeatures.prototype.entityApis = false; + + /** + * SupportedRuntimeFeatures actionApis. + * @member {boolean} actionApis + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @instance + */ + SupportedRuntimeFeatures.prototype.actionApis = false; + + /** + * SupportedRuntimeFeatures sqlQuery. + * @member {boolean} sqlQuery + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @instance + */ + SupportedRuntimeFeatures.prototype.sqlQuery = false; + + /** + * Creates a new SupportedRuntimeFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {google.cloud.connectors.v1.ISupportedRuntimeFeatures=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.SupportedRuntimeFeatures} SupportedRuntimeFeatures instance + */ + SupportedRuntimeFeatures.create = function create(properties) { + return new SupportedRuntimeFeatures(properties); + }; + + /** + * Encodes the specified SupportedRuntimeFeatures message. Does not implicitly {@link google.cloud.connectors.v1.SupportedRuntimeFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {google.cloud.connectors.v1.ISupportedRuntimeFeatures} message SupportedRuntimeFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedRuntimeFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityApis != null && Object.hasOwnProperty.call(message, "entityApis")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entityApis); + if (message.actionApis != null && Object.hasOwnProperty.call(message, "actionApis")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.actionApis); + if (message.sqlQuery != null && Object.hasOwnProperty.call(message, "sqlQuery")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.sqlQuery); + return writer; + }; + + /** + * Encodes the specified SupportedRuntimeFeatures message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SupportedRuntimeFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {google.cloud.connectors.v1.ISupportedRuntimeFeatures} message SupportedRuntimeFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedRuntimeFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupportedRuntimeFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.SupportedRuntimeFeatures} SupportedRuntimeFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedRuntimeFeatures.decode = function 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.connectors.v1.SupportedRuntimeFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entityApis = reader.bool(); + break; + } + case 2: { + message.actionApis = reader.bool(); + break; + } + case 3: { + message.sqlQuery = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupportedRuntimeFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.SupportedRuntimeFeatures} SupportedRuntimeFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedRuntimeFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupportedRuntimeFeatures message. + * @function verify + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupportedRuntimeFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityApis != null && message.hasOwnProperty("entityApis")) + if (typeof message.entityApis !== "boolean") + return "entityApis: boolean expected"; + if (message.actionApis != null && message.hasOwnProperty("actionApis")) + if (typeof message.actionApis !== "boolean") + return "actionApis: boolean expected"; + if (message.sqlQuery != null && message.hasOwnProperty("sqlQuery")) + if (typeof message.sqlQuery !== "boolean") + return "sqlQuery: boolean expected"; + return null; + }; + + /** + * Creates a SupportedRuntimeFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.SupportedRuntimeFeatures} SupportedRuntimeFeatures + */ + SupportedRuntimeFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.SupportedRuntimeFeatures) + return object; + var message = new $root.google.cloud.connectors.v1.SupportedRuntimeFeatures(); + if (object.entityApis != null) + message.entityApis = Boolean(object.entityApis); + if (object.actionApis != null) + message.actionApis = Boolean(object.actionApis); + if (object.sqlQuery != null) + message.sqlQuery = Boolean(object.sqlQuery); + return message; + }; + + /** + * Creates a plain object from a SupportedRuntimeFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {google.cloud.connectors.v1.SupportedRuntimeFeatures} message SupportedRuntimeFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupportedRuntimeFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityApis = false; + object.actionApis = false; + object.sqlQuery = false; + } + if (message.entityApis != null && message.hasOwnProperty("entityApis")) + object.entityApis = message.entityApis; + if (message.actionApis != null && message.hasOwnProperty("actionApis")) + object.actionApis = message.actionApis; + if (message.sqlQuery != null && message.hasOwnProperty("sqlQuery")) + object.sqlQuery = message.sqlQuery; + return object; + }; + + /** + * Converts this SupportedRuntimeFeatures to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @instance + * @returns {Object.} JSON object + */ + SupportedRuntimeFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SupportedRuntimeFeatures + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupportedRuntimeFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.SupportedRuntimeFeatures"; + }; + + return SupportedRuntimeFeatures; + })(); + + v1.EgressControlConfig = (function() { + + /** + * Properties of an EgressControlConfig. + * @memberof google.cloud.connectors.v1 + * @interface IEgressControlConfig + * @property {string|null} [backends] EgressControlConfig backends + * @property {google.cloud.connectors.v1.IExtractionRules|null} [extractionRules] EgressControlConfig extractionRules + */ + + /** + * Constructs a new EgressControlConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an EgressControlConfig. + * @implements IEgressControlConfig + * @constructor + * @param {google.cloud.connectors.v1.IEgressControlConfig=} [properties] Properties to set + */ + function EgressControlConfig(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]]; + } + + /** + * EgressControlConfig backends. + * @member {string|null|undefined} backends + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @instance + */ + EgressControlConfig.prototype.backends = null; + + /** + * EgressControlConfig extractionRules. + * @member {google.cloud.connectors.v1.IExtractionRules|null|undefined} extractionRules + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @instance + */ + EgressControlConfig.prototype.extractionRules = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EgressControlConfig oneofBackends. + * @member {"backends"|"extractionRules"|undefined} oneofBackends + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @instance + */ + Object.defineProperty(EgressControlConfig.prototype, "oneofBackends", { + get: $util.oneOfGetter($oneOfFields = ["backends", "extractionRules"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EgressControlConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {google.cloud.connectors.v1.IEgressControlConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.EgressControlConfig} EgressControlConfig instance + */ + EgressControlConfig.create = function create(properties) { + return new EgressControlConfig(properties); + }; + + /** + * Encodes the specified EgressControlConfig message. Does not implicitly {@link google.cloud.connectors.v1.EgressControlConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {google.cloud.connectors.v1.IEgressControlConfig} message EgressControlConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressControlConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backends != null && Object.hasOwnProperty.call(message, "backends")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backends); + if (message.extractionRules != null && Object.hasOwnProperty.call(message, "extractionRules")) + $root.google.cloud.connectors.v1.ExtractionRules.encode(message.extractionRules, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EgressControlConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.EgressControlConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {google.cloud.connectors.v1.IEgressControlConfig} message EgressControlConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressControlConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressControlConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.EgressControlConfig} EgressControlConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressControlConfig.decode = function 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.connectors.v1.EgressControlConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backends = reader.string(); + break; + } + case 2: { + message.extractionRules = $root.google.cloud.connectors.v1.ExtractionRules.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressControlConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.EgressControlConfig} EgressControlConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressControlConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressControlConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressControlConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backends != null && message.hasOwnProperty("backends")) { + properties.oneofBackends = 1; + if (!$util.isString(message.backends)) + return "backends: string expected"; + } + if (message.extractionRules != null && message.hasOwnProperty("extractionRules")) { + if (properties.oneofBackends === 1) + return "oneofBackends: multiple values"; + properties.oneofBackends = 1; + { + var error = $root.google.cloud.connectors.v1.ExtractionRules.verify(message.extractionRules); + if (error) + return "extractionRules." + error; + } + } + return null; + }; + + /** + * Creates an EgressControlConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.EgressControlConfig} EgressControlConfig + */ + EgressControlConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.EgressControlConfig) + return object; + var message = new $root.google.cloud.connectors.v1.EgressControlConfig(); + if (object.backends != null) + message.backends = String(object.backends); + if (object.extractionRules != null) { + if (typeof object.extractionRules !== "object") + throw TypeError(".google.cloud.connectors.v1.EgressControlConfig.extractionRules: object expected"); + message.extractionRules = $root.google.cloud.connectors.v1.ExtractionRules.fromObject(object.extractionRules); + } + return message; + }; + + /** + * Creates a plain object from an EgressControlConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {google.cloud.connectors.v1.EgressControlConfig} message EgressControlConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressControlConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.backends != null && message.hasOwnProperty("backends")) { + object.backends = message.backends; + if (options.oneofs) + object.oneofBackends = "backends"; + } + if (message.extractionRules != null && message.hasOwnProperty("extractionRules")) { + object.extractionRules = $root.google.cloud.connectors.v1.ExtractionRules.toObject(message.extractionRules, options); + if (options.oneofs) + object.oneofBackends = "extractionRules"; + } + return object; + }; + + /** + * Converts this EgressControlConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @instance + * @returns {Object.} JSON object + */ + EgressControlConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressControlConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressControlConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.EgressControlConfig"; + }; + + return EgressControlConfig; + })(); + + v1.ExtractionRules = (function() { + + /** + * Properties of an ExtractionRules. + * @memberof google.cloud.connectors.v1 + * @interface IExtractionRules + * @property {Array.|null} [extractionRule] ExtractionRules extractionRule + */ + + /** + * Constructs a new ExtractionRules. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an ExtractionRules. + * @implements IExtractionRules + * @constructor + * @param {google.cloud.connectors.v1.IExtractionRules=} [properties] Properties to set + */ + function ExtractionRules(properties) { + this.extractionRule = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtractionRules extractionRule. + * @member {Array.} extractionRule + * @memberof google.cloud.connectors.v1.ExtractionRules + * @instance + */ + ExtractionRules.prototype.extractionRule = $util.emptyArray; + + /** + * Creates a new ExtractionRules instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {google.cloud.connectors.v1.IExtractionRules=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ExtractionRules} ExtractionRules instance + */ + ExtractionRules.create = function create(properties) { + return new ExtractionRules(properties); + }; + + /** + * Encodes the specified ExtractionRules message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRules.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {google.cloud.connectors.v1.IExtractionRules} message ExtractionRules message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtractionRules.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extractionRule != null && message.extractionRule.length) + for (var i = 0; i < message.extractionRule.length; ++i) + $root.google.cloud.connectors.v1.ExtractionRule.encode(message.extractionRule[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtractionRules message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRules.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {google.cloud.connectors.v1.IExtractionRules} message ExtractionRules message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtractionRules.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtractionRules message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ExtractionRules} ExtractionRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtractionRules.decode = function 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.connectors.v1.ExtractionRules(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.extractionRule && message.extractionRule.length)) + message.extractionRule = []; + message.extractionRule.push($root.google.cloud.connectors.v1.ExtractionRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtractionRules message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ExtractionRules} ExtractionRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtractionRules.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtractionRules message. + * @function verify + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtractionRules.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extractionRule != null && message.hasOwnProperty("extractionRule")) { + if (!Array.isArray(message.extractionRule)) + return "extractionRule: array expected"; + for (var i = 0; i < message.extractionRule.length; ++i) { + var error = $root.google.cloud.connectors.v1.ExtractionRule.verify(message.extractionRule[i]); + if (error) + return "extractionRule." + error; + } + } + return null; + }; + + /** + * Creates an ExtractionRules message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ExtractionRules} ExtractionRules + */ + ExtractionRules.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ExtractionRules) + return object; + var message = new $root.google.cloud.connectors.v1.ExtractionRules(); + if (object.extractionRule) { + if (!Array.isArray(object.extractionRule)) + throw TypeError(".google.cloud.connectors.v1.ExtractionRules.extractionRule: array expected"); + message.extractionRule = []; + for (var i = 0; i < object.extractionRule.length; ++i) { + if (typeof object.extractionRule[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ExtractionRules.extractionRule: object expected"); + message.extractionRule[i] = $root.google.cloud.connectors.v1.ExtractionRule.fromObject(object.extractionRule[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtractionRules message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {google.cloud.connectors.v1.ExtractionRules} message ExtractionRules + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtractionRules.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.extractionRule = []; + if (message.extractionRule && message.extractionRule.length) { + object.extractionRule = []; + for (var j = 0; j < message.extractionRule.length; ++j) + object.extractionRule[j] = $root.google.cloud.connectors.v1.ExtractionRule.toObject(message.extractionRule[j], options); + } + return object; + }; + + /** + * Converts this ExtractionRules to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ExtractionRules + * @instance + * @returns {Object.} JSON object + */ + ExtractionRules.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtractionRules + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtractionRules.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ExtractionRules"; + }; + + return ExtractionRules; + })(); + + v1.ExtractionRule = (function() { + + /** + * Properties of an ExtractionRule. + * @memberof google.cloud.connectors.v1 + * @interface IExtractionRule + * @property {google.cloud.connectors.v1.ExtractionRule.ISource|null} [source] ExtractionRule source + * @property {string|null} [extractionRegex] ExtractionRule extractionRegex + */ + + /** + * Constructs a new ExtractionRule. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an ExtractionRule. + * @implements IExtractionRule + * @constructor + * @param {google.cloud.connectors.v1.IExtractionRule=} [properties] Properties to set + */ + function ExtractionRule(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]]; + } + + /** + * ExtractionRule source. + * @member {google.cloud.connectors.v1.ExtractionRule.ISource|null|undefined} source + * @memberof google.cloud.connectors.v1.ExtractionRule + * @instance + */ + ExtractionRule.prototype.source = null; + + /** + * ExtractionRule extractionRegex. + * @member {string} extractionRegex + * @memberof google.cloud.connectors.v1.ExtractionRule + * @instance + */ + ExtractionRule.prototype.extractionRegex = ""; + + /** + * Creates a new ExtractionRule instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {google.cloud.connectors.v1.IExtractionRule=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ExtractionRule} ExtractionRule instance + */ + ExtractionRule.create = function create(properties) { + return new ExtractionRule(properties); + }; + + /** + * Encodes the specified ExtractionRule message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {google.cloud.connectors.v1.IExtractionRule} message ExtractionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtractionRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.connectors.v1.ExtractionRule.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.extractionRegex != null && Object.hasOwnProperty.call(message, "extractionRegex")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extractionRegex); + return writer; + }; + + /** + * Encodes the specified ExtractionRule message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {google.cloud.connectors.v1.IExtractionRule} message ExtractionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtractionRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtractionRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ExtractionRule} ExtractionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtractionRule.decode = function 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.connectors.v1.ExtractionRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.connectors.v1.ExtractionRule.Source.decode(reader, reader.uint32()); + break; + } + case 2: { + message.extractionRegex = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtractionRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ExtractionRule} ExtractionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtractionRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtractionRule message. + * @function verify + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtractionRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.connectors.v1.ExtractionRule.Source.verify(message.source); + if (error) + return "source." + error; + } + if (message.extractionRegex != null && message.hasOwnProperty("extractionRegex")) + if (!$util.isString(message.extractionRegex)) + return "extractionRegex: string expected"; + return null; + }; + + /** + * Creates an ExtractionRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ExtractionRule} ExtractionRule + */ + ExtractionRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ExtractionRule) + return object; + var message = new $root.google.cloud.connectors.v1.ExtractionRule(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.connectors.v1.ExtractionRule.source: object expected"); + message.source = $root.google.cloud.connectors.v1.ExtractionRule.Source.fromObject(object.source); + } + if (object.extractionRegex != null) + message.extractionRegex = String(object.extractionRegex); + return message; + }; + + /** + * Creates a plain object from an ExtractionRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {google.cloud.connectors.v1.ExtractionRule} message ExtractionRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtractionRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.extractionRegex = ""; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.connectors.v1.ExtractionRule.Source.toObject(message.source, options); + if (message.extractionRegex != null && message.hasOwnProperty("extractionRegex")) + object.extractionRegex = message.extractionRegex; + return object; + }; + + /** + * Converts this ExtractionRule to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ExtractionRule + * @instance + * @returns {Object.} JSON object + */ + ExtractionRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtractionRule + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtractionRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ExtractionRule"; + }; + + ExtractionRule.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.cloud.connectors.v1.ExtractionRule + * @interface ISource + * @property {google.cloud.connectors.v1.ExtractionRule.SourceType|null} [sourceType] Source sourceType + * @property {string|null} [fieldId] Source fieldId + */ + + /** + * Constructs a new Source. + * @memberof google.cloud.connectors.v1.ExtractionRule + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.connectors.v1.ExtractionRule.ISource=} [properties] Properties to set + */ + function Source(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]]; + } + + /** + * Source sourceType. + * @member {google.cloud.connectors.v1.ExtractionRule.SourceType} sourceType + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @instance + */ + Source.prototype.sourceType = 0; + + /** + * Source fieldId. + * @member {string} fieldId + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @instance + */ + Source.prototype.fieldId = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {google.cloud.connectors.v1.ExtractionRule.ISource=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ExtractionRule.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {google.cloud.connectors.v1.ExtractionRule.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); + if (message.fieldId != null && Object.hasOwnProperty.call(message, "fieldId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldId); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {google.cloud.connectors.v1.ExtractionRule.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Source message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ExtractionRule.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decode = function 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.connectors.v1.ExtractionRule.Source(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceType = reader.int32(); + break; + } + case 2: { + message.fieldId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ExtractionRule.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Source message. + * @function verify + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Source.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + if (message.fieldId != null && message.hasOwnProperty("fieldId")) + if (!$util.isString(message.fieldId)) + return "fieldId: string expected"; + return null; + }; + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ExtractionRule.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ExtractionRule.Source) + return object; + var message = new $root.google.cloud.connectors.v1.ExtractionRule.Source(); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "CONFIG_VARIABLE": + case 1: + message.sourceType = 1; + break; + } + if (object.fieldId != null) + message.fieldId = String(object.fieldId); + return message; + }; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {google.cloud.connectors.v1.ExtractionRule.Source} message Source + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Source.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceType = options.enums === String ? "SOURCE_TYPE_UNSPECIFIED" : 0; + object.fieldId = ""; + } + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.connectors.v1.ExtractionRule.SourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.connectors.v1.ExtractionRule.SourceType[message.sourceType] : message.sourceType; + if (message.fieldId != null && message.hasOwnProperty("fieldId")) + object.fieldId = message.fieldId; + return object; + }; + + /** + * Converts this Source to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Source + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Source.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ExtractionRule.Source"; + }; + + return Source; + })(); + + /** + * SourceType enum. + * @name google.cloud.connectors.v1.ExtractionRule.SourceType + * @enum {number} + * @property {number} SOURCE_TYPE_UNSPECIFIED=0 SOURCE_TYPE_UNSPECIFIED value + * @property {number} CONFIG_VARIABLE=1 CONFIG_VARIABLE value + */ + ExtractionRule.SourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONFIG_VARIABLE"] = 1; + return values; + })(); + + return ExtractionRule; + })(); + + /** + * ConnectorVersionView enum. + * @name google.cloud.connectors.v1.ConnectorVersionView + * @enum {number} + * @property {number} CONNECTOR_VERSION_VIEW_UNSPECIFIED=0 CONNECTOR_VERSION_VIEW_UNSPECIFIED value + * @property {number} CONNECTOR_VERSION_VIEW_BASIC=1 CONNECTOR_VERSION_VIEW_BASIC value + * @property {number} CONNECTOR_VERSION_VIEW_FULL=2 CONNECTOR_VERSION_VIEW_FULL value + */ + v1.ConnectorVersionView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONNECTOR_VERSION_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONNECTOR_VERSION_VIEW_BASIC"] = 1; + values[valuesById[2] = "CONNECTOR_VERSION_VIEW_FULL"] = 2; + return values; + })(); + + v1.Connectors = (function() { + + /** + * Constructs a new Connectors service. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Connectors + * @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 Connectors(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Connectors.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Connectors; + + /** + * Creates new Connectors service using the specified rpc implementation. + * @function create + * @memberof google.cloud.connectors.v1.Connectors + * @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 {Connectors} RPC service. Useful where requests and/or responses are streamed. + */ + Connectors.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnections}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListConnectionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListConnectionsResponse} [response] ListConnectionsResponse + */ + + /** + * Calls ListConnections. + * @function listConnections + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectionsRequest} request ListConnectionsRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListConnectionsCallback} callback Node-style callback called with the error, if any, and ListConnectionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listConnections = function listConnections(request, callback) { + return this.rpcCall(listConnections, $root.google.cloud.connectors.v1.ListConnectionsRequest, $root.google.cloud.connectors.v1.ListConnectionsResponse, request, callback); + }, "name", { value: "ListConnections" }); + + /** + * Calls ListConnections. + * @function listConnections + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectionsRequest} request ListConnectionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnection}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.Connection} [response] Connection + */ + + /** + * Calls GetConnection. + * @function getConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectionRequest} request GetConnectionRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetConnectionCallback} callback Node-style callback called with the error, if any, and Connection + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getConnection = function getConnection(request, callback) { + return this.rpcCall(getConnection, $root.google.cloud.connectors.v1.GetConnectionRequest, $root.google.cloud.connectors.v1.Connection, request, callback); + }, "name", { value: "GetConnection" }); + + /** + * Calls GetConnection. + * @function getConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectionRequest} request GetConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|createConnection}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef CreateConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateConnection. + * @function createConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.ICreateConnectionRequest} request CreateConnectionRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.CreateConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.createConnection = function createConnection(request, callback) { + return this.rpcCall(createConnection, $root.google.cloud.connectors.v1.CreateConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateConnection" }); + + /** + * Calls CreateConnection. + * @function createConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.ICreateConnectionRequest} request CreateConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|updateConnection}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef UpdateConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateConnection. + * @function updateConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest} request UpdateConnectionRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.UpdateConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.updateConnection = function updateConnection(request, callback) { + return this.rpcCall(updateConnection, $root.google.cloud.connectors.v1.UpdateConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateConnection" }); + + /** + * Calls UpdateConnection. + * @function updateConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest} request UpdateConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|deleteConnection}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef DeleteConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteConnection. + * @function deleteConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest} request DeleteConnectionRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.DeleteConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.deleteConnection = function deleteConnection(request, callback) { + return this.rpcCall(deleteConnection, $root.google.cloud.connectors.v1.DeleteConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteConnection" }); + + /** + * Calls DeleteConnection. + * @function deleteConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest} request DeleteConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listProviders}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListProvidersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListProvidersResponse} [response] ListProvidersResponse + */ + + /** + * Calls ListProviders. + * @function listProviders + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListProvidersRequest} request ListProvidersRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListProvidersCallback} callback Node-style callback called with the error, if any, and ListProvidersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listProviders = function listProviders(request, callback) { + return this.rpcCall(listProviders, $root.google.cloud.connectors.v1.ListProvidersRequest, $root.google.cloud.connectors.v1.ListProvidersResponse, request, callback); + }, "name", { value: "ListProviders" }); + + /** + * Calls ListProviders. + * @function listProviders + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListProvidersRequest} request ListProvidersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getProvider}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetProviderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.Provider} [response] Provider + */ + + /** + * Calls GetProvider. + * @function getProvider + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetProviderRequest} request GetProviderRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetProviderCallback} callback Node-style callback called with the error, if any, and Provider + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getProvider = function getProvider(request, callback) { + return this.rpcCall(getProvider, $root.google.cloud.connectors.v1.GetProviderRequest, $root.google.cloud.connectors.v1.Provider, request, callback); + }, "name", { value: "GetProvider" }); + + /** + * Calls GetProvider. + * @function getProvider + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetProviderRequest} request GetProviderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnectors}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListConnectorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListConnectorsResponse} [response] ListConnectorsResponse + */ + + /** + * Calls ListConnectors. + * @function listConnectors + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectorsRequest} request ListConnectorsRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListConnectorsCallback} callback Node-style callback called with the error, if any, and ListConnectorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listConnectors = function listConnectors(request, callback) { + return this.rpcCall(listConnectors, $root.google.cloud.connectors.v1.ListConnectorsRequest, $root.google.cloud.connectors.v1.ListConnectorsResponse, request, callback); + }, "name", { value: "ListConnectors" }); + + /** + * Calls ListConnectors. + * @function listConnectors + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectorsRequest} request ListConnectorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnector}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetConnectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.Connector} [response] Connector + */ + + /** + * Calls GetConnector. + * @function getConnector + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectorRequest} request GetConnectorRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetConnectorCallback} callback Node-style callback called with the error, if any, and Connector + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getConnector = function getConnector(request, callback) { + return this.rpcCall(getConnector, $root.google.cloud.connectors.v1.GetConnectorRequest, $root.google.cloud.connectors.v1.Connector, request, callback); + }, "name", { value: "GetConnector" }); + + /** + * Calls GetConnector. + * @function getConnector + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectorRequest} request GetConnectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnectorVersions}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListConnectorVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListConnectorVersionsResponse} [response] ListConnectorVersionsResponse + */ + + /** + * Calls ListConnectorVersions. + * @function listConnectorVersions + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest} request ListConnectorVersionsRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListConnectorVersionsCallback} callback Node-style callback called with the error, if any, and ListConnectorVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listConnectorVersions = function listConnectorVersions(request, callback) { + return this.rpcCall(listConnectorVersions, $root.google.cloud.connectors.v1.ListConnectorVersionsRequest, $root.google.cloud.connectors.v1.ListConnectorVersionsResponse, request, callback); + }, "name", { value: "ListConnectorVersions" }); + + /** + * Calls ListConnectorVersions. + * @function listConnectorVersions + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest} request ListConnectorVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnectorVersion}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetConnectorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ConnectorVersion} [response] ConnectorVersion + */ + + /** + * Calls GetConnectorVersion. + * @function getConnectorVersion + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest} request GetConnectorVersionRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetConnectorVersionCallback} callback Node-style callback called with the error, if any, and ConnectorVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getConnectorVersion = function getConnectorVersion(request, callback) { + return this.rpcCall(getConnectorVersion, $root.google.cloud.connectors.v1.GetConnectorVersionRequest, $root.google.cloud.connectors.v1.ConnectorVersion, request, callback); + }, "name", { value: "GetConnectorVersion" }); + + /** + * Calls GetConnectorVersion. + * @function getConnectorVersion + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest} request GetConnectorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnectionSchemaMetadata}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetConnectionSchemaMetadataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ConnectionSchemaMetadata} [response] ConnectionSchemaMetadata + */ + + /** + * Calls GetConnectionSchemaMetadata. + * @function getConnectionSchemaMetadata + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest} request GetConnectionSchemaMetadataRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetConnectionSchemaMetadataCallback} callback Node-style callback called with the error, if any, and ConnectionSchemaMetadata + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getConnectionSchemaMetadata = function getConnectionSchemaMetadata(request, callback) { + return this.rpcCall(getConnectionSchemaMetadata, $root.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest, $root.google.cloud.connectors.v1.ConnectionSchemaMetadata, request, callback); + }, "name", { value: "GetConnectionSchemaMetadata" }); + + /** + * Calls GetConnectionSchemaMetadata. + * @function getConnectionSchemaMetadata + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest} request GetConnectionSchemaMetadataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|refreshConnectionSchemaMetadata}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef RefreshConnectionSchemaMetadataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RefreshConnectionSchemaMetadata. + * @function refreshConnectionSchemaMetadata + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest} request RefreshConnectionSchemaMetadataRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.RefreshConnectionSchemaMetadataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.refreshConnectionSchemaMetadata = function refreshConnectionSchemaMetadata(request, callback) { + return this.rpcCall(refreshConnectionSchemaMetadata, $root.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RefreshConnectionSchemaMetadata" }); + + /** + * Calls RefreshConnectionSchemaMetadata. + * @function refreshConnectionSchemaMetadata + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest} request RefreshConnectionSchemaMetadataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listRuntimeEntitySchemas}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListRuntimeEntitySchemasCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} [response] ListRuntimeEntitySchemasResponse + */ + + /** + * Calls ListRuntimeEntitySchemas. + * @function listRuntimeEntitySchemas + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest} request ListRuntimeEntitySchemasRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListRuntimeEntitySchemasCallback} callback Node-style callback called with the error, if any, and ListRuntimeEntitySchemasResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listRuntimeEntitySchemas = function listRuntimeEntitySchemas(request, callback) { + return this.rpcCall(listRuntimeEntitySchemas, $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest, $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse, request, callback); + }, "name", { value: "ListRuntimeEntitySchemas" }); + + /** + * Calls ListRuntimeEntitySchemas. + * @function listRuntimeEntitySchemas + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest} request ListRuntimeEntitySchemasRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listRuntimeActionSchemas}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListRuntimeActionSchemasCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} [response] ListRuntimeActionSchemasResponse + */ + + /** + * Calls ListRuntimeActionSchemas. + * @function listRuntimeActionSchemas + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest} request ListRuntimeActionSchemasRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListRuntimeActionSchemasCallback} callback Node-style callback called with the error, if any, and ListRuntimeActionSchemasResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listRuntimeActionSchemas = function listRuntimeActionSchemas(request, callback) { + return this.rpcCall(listRuntimeActionSchemas, $root.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest, $root.google.cloud.connectors.v1.ListRuntimeActionSchemasResponse, request, callback); + }, "name", { value: "ListRuntimeActionSchemas" }); + + /** + * Calls ListRuntimeActionSchemas. + * @function listRuntimeActionSchemas + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest} request ListRuntimeActionSchemasRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getRuntimeConfig}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetRuntimeConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.RuntimeConfig} [response] RuntimeConfig + */ + + /** + * Calls GetRuntimeConfig. + * @function getRuntimeConfig + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest} request GetRuntimeConfigRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetRuntimeConfigCallback} callback Node-style callback called with the error, if any, and RuntimeConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getRuntimeConfig = function getRuntimeConfig(request, callback) { + return this.rpcCall(getRuntimeConfig, $root.google.cloud.connectors.v1.GetRuntimeConfigRequest, $root.google.cloud.connectors.v1.RuntimeConfig, request, callback); + }, "name", { value: "GetRuntimeConfig" }); + + /** + * Calls GetRuntimeConfig. + * @function getRuntimeConfig + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest} request GetRuntimeConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getGlobalSettings}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetGlobalSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.Settings} [response] Settings + */ + + /** + * Calls GetGlobalSettings. + * @function getGlobalSettings + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest} request GetGlobalSettingsRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetGlobalSettingsCallback} callback Node-style callback called with the error, if any, and Settings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getGlobalSettings = function getGlobalSettings(request, callback) { + return this.rpcCall(getGlobalSettings, $root.google.cloud.connectors.v1.GetGlobalSettingsRequest, $root.google.cloud.connectors.v1.Settings, request, callback); + }, "name", { value: "GetGlobalSettings" }); + + /** + * Calls GetGlobalSettings. + * @function getGlobalSettings + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest} request GetGlobalSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Connectors; + })(); + + v1.Provider = (function() { + + /** + * Properties of a Provider. + * @memberof google.cloud.connectors.v1 + * @interface IProvider + * @property {string|null} [name] Provider name + * @property {google.protobuf.ITimestamp|null} [createTime] Provider createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Provider updateTime + * @property {Object.|null} [labels] Provider labels + * @property {string|null} [documentationUri] Provider documentationUri + * @property {string|null} [externalUri] Provider externalUri + * @property {string|null} [description] Provider description + * @property {string|null} [webAssetsLocation] Provider webAssetsLocation + * @property {string|null} [displayName] Provider displayName + * @property {google.cloud.connectors.v1.LaunchStage|null} [launchStage] Provider launchStage + */ + + /** + * Constructs a new Provider. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Provider. + * @implements IProvider + * @constructor + * @param {google.cloud.connectors.v1.IProvider=} [properties] Properties to set + */ + function Provider(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Provider name. + * @member {string} name + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.name = ""; + + /** + * Provider createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.createTime = null; + + /** + * Provider updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.updateTime = null; + + /** + * Provider labels. + * @member {Object.} labels + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.labels = $util.emptyObject; + + /** + * Provider documentationUri. + * @member {string} documentationUri + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.documentationUri = ""; + + /** + * Provider externalUri. + * @member {string} externalUri + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.externalUri = ""; + + /** + * Provider description. + * @member {string} description + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.description = ""; + + /** + * Provider webAssetsLocation. + * @member {string} webAssetsLocation + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.webAssetsLocation = ""; + + /** + * Provider displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.displayName = ""; + + /** + * Provider launchStage. + * @member {google.cloud.connectors.v1.LaunchStage} launchStage + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.launchStage = 0; + + /** + * Creates a new Provider instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {google.cloud.connectors.v1.IProvider=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Provider} Provider instance + */ + Provider.create = function create(properties) { + return new Provider(properties); + }; + + /** + * Encodes the specified Provider message. Does not implicitly {@link google.cloud.connectors.v1.Provider.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {google.cloud.connectors.v1.IProvider} message Provider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Provider.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.documentationUri); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.externalUri); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + if (message.webAssetsLocation != null && Object.hasOwnProperty.call(message, "webAssetsLocation")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.webAssetsLocation); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.launchStage); + return writer; + }; + + /** + * Encodes the specified Provider message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Provider.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {google.cloud.connectors.v1.IProvider} message Provider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Provider.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Provider message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Provider} Provider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Provider.decode = function 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.connectors.v1.Provider(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.documentationUri = reader.string(); + break; + } + case 7: { + message.externalUri = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 9: { + message.webAssetsLocation = reader.string(); + break; + } + case 10: { + message.displayName = reader.string(); + break; + } + case 11: { + message.launchStage = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Provider message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Provider} Provider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Provider.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Provider message. + * @function verify + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Provider.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.webAssetsLocation != null && message.hasOwnProperty("webAssetsLocation")) + if (!$util.isString(message.webAssetsLocation)) + return "webAssetsLocation: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + return null; + }; + + /** + * Creates a Provider message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Provider} Provider + */ + Provider.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Provider) + return object; + var message = new $root.google.cloud.connectors.v1.Provider(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.connectors.v1.Provider.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.connectors.v1.Provider.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.connectors.v1.Provider.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.description != null) + message.description = String(object.description); + if (object.webAssetsLocation != null) + message.webAssetsLocation = String(object.webAssetsLocation); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "PREVIEW": + case 1: + message.launchStage = 1; + break; + case "GA": + case 2: + message.launchStage = 2; + break; + case "DEPRECATED": + case 3: + message.launchStage = 3; + break; + case "PRIVATE_PREVIEW": + case 5: + message.launchStage = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a Provider message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {google.cloud.connectors.v1.Provider} message Provider + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Provider.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.documentationUri = ""; + object.externalUri = ""; + object.description = ""; + object.webAssetsLocation = ""; + object.displayName = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.webAssetsLocation != null && message.hasOwnProperty("webAssetsLocation")) + object.webAssetsLocation = message.webAssetsLocation; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] : message.launchStage; + return object; + }; + + /** + * Converts this Provider to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Provider + * @instance + * @returns {Object.} JSON object + */ + Provider.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Provider + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Provider.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Provider"; + }; + + return Provider; + })(); + + v1.GetProviderRequest = (function() { + + /** + * Properties of a GetProviderRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetProviderRequest + * @property {string|null} [name] GetProviderRequest name + */ + + /** + * Constructs a new GetProviderRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetProviderRequest. + * @implements IGetProviderRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetProviderRequest=} [properties] Properties to set + */ + function GetProviderRequest(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]]; + } + + /** + * GetProviderRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @instance + */ + GetProviderRequest.prototype.name = ""; + + /** + * Creates a new GetProviderRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {google.cloud.connectors.v1.IGetProviderRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetProviderRequest} GetProviderRequest instance + */ + GetProviderRequest.create = function create(properties) { + return new GetProviderRequest(properties); + }; + + /** + * Encodes the specified GetProviderRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetProviderRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {google.cloud.connectors.v1.IGetProviderRequest} message GetProviderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProviderRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetProviderRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetProviderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {google.cloud.connectors.v1.IGetProviderRequest} message GetProviderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProviderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProviderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetProviderRequest} GetProviderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProviderRequest.decode = function 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.connectors.v1.GetProviderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProviderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetProviderRequest} GetProviderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProviderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProviderRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProviderRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetProviderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetProviderRequest} GetProviderRequest + */ + GetProviderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetProviderRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetProviderRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProviderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {google.cloud.connectors.v1.GetProviderRequest} message GetProviderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProviderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetProviderRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @instance + * @returns {Object.} JSON object + */ + GetProviderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProviderRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProviderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetProviderRequest"; + }; + + return GetProviderRequest; + })(); + + v1.ListProvidersRequest = (function() { + + /** + * Properties of a ListProvidersRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListProvidersRequest + * @property {string|null} [parent] ListProvidersRequest parent + * @property {number|null} [pageSize] ListProvidersRequest pageSize + * @property {string|null} [pageToken] ListProvidersRequest pageToken + */ + + /** + * Constructs a new ListProvidersRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListProvidersRequest. + * @implements IListProvidersRequest + * @constructor + * @param {google.cloud.connectors.v1.IListProvidersRequest=} [properties] Properties to set + */ + function ListProvidersRequest(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]]; + } + + /** + * ListProvidersRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @instance + */ + ListProvidersRequest.prototype.parent = ""; + + /** + * ListProvidersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @instance + */ + ListProvidersRequest.prototype.pageSize = 0; + + /** + * ListProvidersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @instance + */ + ListProvidersRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProvidersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {google.cloud.connectors.v1.IListProvidersRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListProvidersRequest} ListProvidersRequest instance + */ + ListProvidersRequest.create = function create(properties) { + return new ListProvidersRequest(properties); + }; + + /** + * Encodes the specified ListProvidersRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {google.cloud.connectors.v1.IListProvidersRequest} message ListProvidersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProvidersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListProvidersRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {google.cloud.connectors.v1.IListProvidersRequest} message ListProvidersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProvidersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProvidersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListProvidersRequest} ListProvidersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProvidersRequest.decode = function 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.connectors.v1.ListProvidersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProvidersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListProvidersRequest} ListProvidersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProvidersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProvidersRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProvidersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListProvidersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListProvidersRequest} ListProvidersRequest + */ + ListProvidersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListProvidersRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListProvidersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListProvidersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {google.cloud.connectors.v1.ListProvidersRequest} message ListProvidersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProvidersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListProvidersRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @instance + * @returns {Object.} JSON object + */ + ListProvidersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProvidersRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProvidersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListProvidersRequest"; + }; + + return ListProvidersRequest; + })(); + + v1.ListProvidersResponse = (function() { + + /** + * Properties of a ListProvidersResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListProvidersResponse + * @property {Array.|null} [providers] ListProvidersResponse providers + * @property {string|null} [nextPageToken] ListProvidersResponse nextPageToken + * @property {Array.|null} [unreachable] ListProvidersResponse unreachable + */ + + /** + * Constructs a new ListProvidersResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListProvidersResponse. + * @implements IListProvidersResponse + * @constructor + * @param {google.cloud.connectors.v1.IListProvidersResponse=} [properties] Properties to set + */ + function ListProvidersResponse(properties) { + this.providers = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProvidersResponse providers. + * @member {Array.} providers + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @instance + */ + ListProvidersResponse.prototype.providers = $util.emptyArray; + + /** + * ListProvidersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @instance + */ + ListProvidersResponse.prototype.nextPageToken = ""; + + /** + * ListProvidersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @instance + */ + ListProvidersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListProvidersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {google.cloud.connectors.v1.IListProvidersResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListProvidersResponse} ListProvidersResponse instance + */ + ListProvidersResponse.create = function create(properties) { + return new ListProvidersResponse(properties); + }; + + /** + * Encodes the specified ListProvidersResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {google.cloud.connectors.v1.IListProvidersResponse} message ListProvidersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProvidersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.providers != null && message.providers.length) + for (var i = 0; i < message.providers.length; ++i) + $root.google.cloud.connectors.v1.Provider.encode(message.providers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListProvidersResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {google.cloud.connectors.v1.IListProvidersResponse} message ListProvidersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProvidersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProvidersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListProvidersResponse} ListProvidersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProvidersResponse.decode = function 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.connectors.v1.ListProvidersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.providers && message.providers.length)) + message.providers = []; + message.providers.push($root.google.cloud.connectors.v1.Provider.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProvidersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListProvidersResponse} ListProvidersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProvidersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProvidersResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProvidersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.providers != null && message.hasOwnProperty("providers")) { + if (!Array.isArray(message.providers)) + return "providers: array expected"; + for (var i = 0; i < message.providers.length; ++i) { + var error = $root.google.cloud.connectors.v1.Provider.verify(message.providers[i]); + if (error) + return "providers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListProvidersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListProvidersResponse} ListProvidersResponse + */ + ListProvidersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListProvidersResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListProvidersResponse(); + if (object.providers) { + if (!Array.isArray(object.providers)) + throw TypeError(".google.cloud.connectors.v1.ListProvidersResponse.providers: array expected"); + message.providers = []; + for (var i = 0; i < object.providers.length; ++i) { + if (typeof object.providers[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListProvidersResponse.providers: object expected"); + message.providers[i] = $root.google.cloud.connectors.v1.Provider.fromObject(object.providers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.connectors.v1.ListProvidersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListProvidersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {google.cloud.connectors.v1.ListProvidersResponse} message ListProvidersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProvidersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.providers = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.providers && message.providers.length) { + object.providers = []; + for (var j = 0; j < message.providers.length; ++j) + object.providers[j] = $root.google.cloud.connectors.v1.Provider.toObject(message.providers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListProvidersResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @instance + * @returns {Object.} JSON object + */ + ListProvidersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProvidersResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProvidersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListProvidersResponse"; + }; + + return ListProvidersResponse; + })(); + + v1.GetRuntimeConfigRequest = (function() { + + /** + * Properties of a GetRuntimeConfigRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetRuntimeConfigRequest + * @property {string|null} [name] GetRuntimeConfigRequest name + */ + + /** + * Constructs a new GetRuntimeConfigRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetRuntimeConfigRequest. + * @implements IGetRuntimeConfigRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest=} [properties] Properties to set + */ + function GetRuntimeConfigRequest(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]]; + } + + /** + * GetRuntimeConfigRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @instance + */ + GetRuntimeConfigRequest.prototype.name = ""; + + /** + * Creates a new GetRuntimeConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetRuntimeConfigRequest} GetRuntimeConfigRequest instance + */ + GetRuntimeConfigRequest.create = function create(properties) { + return new GetRuntimeConfigRequest(properties); + }; + + /** + * Encodes the specified GetRuntimeConfigRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetRuntimeConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest} message GetRuntimeConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuntimeConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetRuntimeConfigRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetRuntimeConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest} message GetRuntimeConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuntimeConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRuntimeConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetRuntimeConfigRequest} GetRuntimeConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuntimeConfigRequest.decode = function 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.connectors.v1.GetRuntimeConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRuntimeConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetRuntimeConfigRequest} GetRuntimeConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuntimeConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRuntimeConfigRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRuntimeConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetRuntimeConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetRuntimeConfigRequest} GetRuntimeConfigRequest + */ + GetRuntimeConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetRuntimeConfigRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetRuntimeConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRuntimeConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {google.cloud.connectors.v1.GetRuntimeConfigRequest} message GetRuntimeConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRuntimeConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetRuntimeConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetRuntimeConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRuntimeConfigRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRuntimeConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetRuntimeConfigRequest"; + }; + + return GetRuntimeConfigRequest; + })(); + + v1.RuntimeConfig = (function() { + + /** + * Properties of a RuntimeConfig. + * @memberof google.cloud.connectors.v1 + * @interface IRuntimeConfig + * @property {string|null} [locationId] RuntimeConfig locationId + * @property {string|null} [conndTopic] RuntimeConfig conndTopic + * @property {string|null} [conndSubscription] RuntimeConfig conndSubscription + * @property {string|null} [controlPlaneTopic] RuntimeConfig controlPlaneTopic + * @property {string|null} [controlPlaneSubscription] RuntimeConfig controlPlaneSubscription + * @property {string|null} [runtimeEndpoint] RuntimeConfig runtimeEndpoint + * @property {google.cloud.connectors.v1.RuntimeConfig.State|null} [state] RuntimeConfig state + * @property {string|null} [schemaGcsBucket] RuntimeConfig schemaGcsBucket + * @property {string|null} [serviceDirectory] RuntimeConfig serviceDirectory + * @property {string|null} [name] RuntimeConfig name + */ + + /** + * Constructs a new RuntimeConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a RuntimeConfig. + * @implements IRuntimeConfig + * @constructor + * @param {google.cloud.connectors.v1.IRuntimeConfig=} [properties] Properties to set + */ + function RuntimeConfig(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]]; + } + + /** + * RuntimeConfig locationId. + * @member {string} locationId + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.locationId = ""; + + /** + * RuntimeConfig conndTopic. + * @member {string} conndTopic + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.conndTopic = ""; + + /** + * RuntimeConfig conndSubscription. + * @member {string} conndSubscription + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.conndSubscription = ""; + + /** + * RuntimeConfig controlPlaneTopic. + * @member {string} controlPlaneTopic + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.controlPlaneTopic = ""; + + /** + * RuntimeConfig controlPlaneSubscription. + * @member {string} controlPlaneSubscription + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.controlPlaneSubscription = ""; + + /** + * RuntimeConfig runtimeEndpoint. + * @member {string} runtimeEndpoint + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.runtimeEndpoint = ""; + + /** + * RuntimeConfig state. + * @member {google.cloud.connectors.v1.RuntimeConfig.State} state + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.state = 0; + + /** + * RuntimeConfig schemaGcsBucket. + * @member {string} schemaGcsBucket + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.schemaGcsBucket = ""; + + /** + * RuntimeConfig serviceDirectory. + * @member {string} serviceDirectory + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.serviceDirectory = ""; + + /** + * RuntimeConfig name. + * @member {string} name + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.name = ""; + + /** + * Creates a new RuntimeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {google.cloud.connectors.v1.IRuntimeConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeConfig} RuntimeConfig instance + */ + RuntimeConfig.create = function create(properties) { + return new RuntimeConfig(properties); + }; + + /** + * Encodes the specified RuntimeConfig message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {google.cloud.connectors.v1.IRuntimeConfig} message RuntimeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationId); + if (message.conndTopic != null && Object.hasOwnProperty.call(message, "conndTopic")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.conndTopic); + if (message.conndSubscription != null && Object.hasOwnProperty.call(message, "conndSubscription")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.conndSubscription); + if (message.controlPlaneTopic != null && Object.hasOwnProperty.call(message, "controlPlaneTopic")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.controlPlaneTopic); + if (message.controlPlaneSubscription != null && Object.hasOwnProperty.call(message, "controlPlaneSubscription")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.controlPlaneSubscription); + if (message.runtimeEndpoint != null && Object.hasOwnProperty.call(message, "runtimeEndpoint")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.runtimeEndpoint); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.schemaGcsBucket != null && Object.hasOwnProperty.call(message, "schemaGcsBucket")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.schemaGcsBucket); + if (message.serviceDirectory != null && Object.hasOwnProperty.call(message, "serviceDirectory")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceDirectory); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.name); + return writer; + }; + + /** + * Encodes the specified RuntimeConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {google.cloud.connectors.v1.IRuntimeConfig} message RuntimeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeConfig} RuntimeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeConfig.decode = function 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.connectors.v1.RuntimeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.locationId = reader.string(); + break; + } + case 2: { + message.conndTopic = reader.string(); + break; + } + case 3: { + message.conndSubscription = reader.string(); + break; + } + case 4: { + message.controlPlaneTopic = reader.string(); + break; + } + case 5: { + message.controlPlaneSubscription = reader.string(); + break; + } + case 6: { + message.runtimeEndpoint = reader.string(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.schemaGcsBucket = reader.string(); + break; + } + case 9: { + message.serviceDirectory = reader.string(); + break; + } + case 11: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeConfig} RuntimeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + if (message.conndTopic != null && message.hasOwnProperty("conndTopic")) + if (!$util.isString(message.conndTopic)) + return "conndTopic: string expected"; + if (message.conndSubscription != null && message.hasOwnProperty("conndSubscription")) + if (!$util.isString(message.conndSubscription)) + return "conndSubscription: string expected"; + if (message.controlPlaneTopic != null && message.hasOwnProperty("controlPlaneTopic")) + if (!$util.isString(message.controlPlaneTopic)) + return "controlPlaneTopic: string expected"; + if (message.controlPlaneSubscription != null && message.hasOwnProperty("controlPlaneSubscription")) + if (!$util.isString(message.controlPlaneSubscription)) + return "controlPlaneSubscription: string expected"; + if (message.runtimeEndpoint != null && message.hasOwnProperty("runtimeEndpoint")) + if (!$util.isString(message.runtimeEndpoint)) + return "runtimeEndpoint: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.schemaGcsBucket != null && message.hasOwnProperty("schemaGcsBucket")) + if (!$util.isString(message.schemaGcsBucket)) + return "schemaGcsBucket: string expected"; + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) + if (!$util.isString(message.serviceDirectory)) + return "serviceDirectory: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a RuntimeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeConfig} RuntimeConfig + */ + RuntimeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeConfig) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeConfig(); + if (object.locationId != null) + message.locationId = String(object.locationId); + if (object.conndTopic != null) + message.conndTopic = String(object.conndTopic); + if (object.conndSubscription != null) + message.conndSubscription = String(object.conndSubscription); + if (object.controlPlaneTopic != null) + message.controlPlaneTopic = String(object.controlPlaneTopic); + if (object.controlPlaneSubscription != null) + message.controlPlaneSubscription = String(object.controlPlaneSubscription); + if (object.runtimeEndpoint != null) + message.runtimeEndpoint = String(object.runtimeEndpoint); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "INACTIVE": + case 1: + message.state = 1; + break; + case "ACTIVATING": + case 2: + message.state = 2; + break; + case "ACTIVE": + case 3: + message.state = 3; + break; + case "CREATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "UPDATING": + case 6: + message.state = 6; + break; + } + if (object.schemaGcsBucket != null) + message.schemaGcsBucket = String(object.schemaGcsBucket); + if (object.serviceDirectory != null) + message.serviceDirectory = String(object.serviceDirectory); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RuntimeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {google.cloud.connectors.v1.RuntimeConfig} message RuntimeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.locationId = ""; + object.conndTopic = ""; + object.conndSubscription = ""; + object.controlPlaneTopic = ""; + object.controlPlaneSubscription = ""; + object.runtimeEndpoint = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.schemaGcsBucket = ""; + object.serviceDirectory = ""; + object.name = ""; + } + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + if (message.conndTopic != null && message.hasOwnProperty("conndTopic")) + object.conndTopic = message.conndTopic; + if (message.conndSubscription != null && message.hasOwnProperty("conndSubscription")) + object.conndSubscription = message.conndSubscription; + if (message.controlPlaneTopic != null && message.hasOwnProperty("controlPlaneTopic")) + object.controlPlaneTopic = message.controlPlaneTopic; + if (message.controlPlaneSubscription != null && message.hasOwnProperty("controlPlaneSubscription")) + object.controlPlaneSubscription = message.controlPlaneSubscription; + if (message.runtimeEndpoint != null && message.hasOwnProperty("runtimeEndpoint")) + object.runtimeEndpoint = message.runtimeEndpoint; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.connectors.v1.RuntimeConfig.State[message.state] === undefined ? message.state : $root.google.cloud.connectors.v1.RuntimeConfig.State[message.state] : message.state; + if (message.schemaGcsBucket != null && message.hasOwnProperty("schemaGcsBucket")) + object.schemaGcsBucket = message.schemaGcsBucket; + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) + object.serviceDirectory = message.serviceDirectory; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this RuntimeConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + * @returns {Object.} JSON object + */ + RuntimeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeConfig"; + }; + + /** + * State enum. + * @name google.cloud.connectors.v1.RuntimeConfig.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} INACTIVE=1 INACTIVE value + * @property {number} ACTIVATING=2 ACTIVATING value + * @property {number} ACTIVE=3 ACTIVE value + * @property {number} CREATING=4 CREATING value + * @property {number} DELETING=5 DELETING value + * @property {number} UPDATING=6 UPDATING value + */ + RuntimeConfig.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INACTIVE"] = 1; + values[valuesById[2] = "ACTIVATING"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + values[valuesById[4] = "CREATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "UPDATING"] = 6; + return values; + })(); + + return RuntimeConfig; + })(); + + v1.GetGlobalSettingsRequest = (function() { + + /** + * Properties of a GetGlobalSettingsRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetGlobalSettingsRequest + * @property {string|null} [name] GetGlobalSettingsRequest name + */ + + /** + * Constructs a new GetGlobalSettingsRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetGlobalSettingsRequest. + * @implements IGetGlobalSettingsRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest=} [properties] Properties to set + */ + function GetGlobalSettingsRequest(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]]; + } + + /** + * GetGlobalSettingsRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @instance + */ + GetGlobalSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetGlobalSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetGlobalSettingsRequest} GetGlobalSettingsRequest instance + */ + GetGlobalSettingsRequest.create = function create(properties) { + return new GetGlobalSettingsRequest(properties); + }; + + /** + * Encodes the specified GetGlobalSettingsRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetGlobalSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest} message GetGlobalSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetGlobalSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetGlobalSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest} message GetGlobalSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlobalSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetGlobalSettingsRequest} GetGlobalSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalSettingsRequest.decode = function 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.connectors.v1.GetGlobalSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlobalSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetGlobalSettingsRequest} GetGlobalSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlobalSettingsRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlobalSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetGlobalSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetGlobalSettingsRequest} GetGlobalSettingsRequest + */ + GetGlobalSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetGlobalSettingsRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetGlobalSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGlobalSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {google.cloud.connectors.v1.GetGlobalSettingsRequest} message GetGlobalSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlobalSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetGlobalSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlobalSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGlobalSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGlobalSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetGlobalSettingsRequest"; + }; + + return GetGlobalSettingsRequest; + })(); + + v1.Settings = (function() { + + /** + * Properties of a Settings. + * @memberof google.cloud.connectors.v1 + * @interface ISettings + * @property {string|null} [name] Settings name + * @property {boolean|null} [vpcsc] Settings vpcsc + * @property {boolean|null} [payg] Settings payg + */ + + /** + * Constructs a new Settings. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Settings. + * @implements ISettings + * @constructor + * @param {google.cloud.connectors.v1.ISettings=} [properties] Properties to set + */ + function Settings(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]]; + } + + /** + * Settings name. + * @member {string} name + * @memberof google.cloud.connectors.v1.Settings + * @instance + */ + Settings.prototype.name = ""; + + /** + * Settings vpcsc. + * @member {boolean} vpcsc + * @memberof google.cloud.connectors.v1.Settings + * @instance + */ + Settings.prototype.vpcsc = false; + + /** + * Settings payg. + * @member {boolean} payg + * @memberof google.cloud.connectors.v1.Settings + * @instance + */ + Settings.prototype.payg = false; + + /** + * Creates a new Settings instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {google.cloud.connectors.v1.ISettings=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Settings} Settings instance + */ + Settings.create = function create(properties) { + return new Settings(properties); + }; + + /** + * Encodes the specified Settings message. Does not implicitly {@link google.cloud.connectors.v1.Settings.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {google.cloud.connectors.v1.ISettings} message Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Settings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.vpcsc != null && Object.hasOwnProperty.call(message, "vpcsc")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.vpcsc); + if (message.payg != null && Object.hasOwnProperty.call(message, "payg")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.payg); + return writer; + }; + + /** + * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Settings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {google.cloud.connectors.v1.ISettings} message Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Settings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Settings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Settings} Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Settings.decode = function 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.connectors.v1.Settings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.vpcsc = reader.bool(); + break; + } + case 3: { + message.payg = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Settings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Settings} Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Settings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Settings message. + * @function verify + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Settings.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.vpcsc != null && message.hasOwnProperty("vpcsc")) + if (typeof message.vpcsc !== "boolean") + return "vpcsc: boolean expected"; + if (message.payg != null && message.hasOwnProperty("payg")) + if (typeof message.payg !== "boolean") + return "payg: boolean expected"; + return null; + }; + + /** + * Creates a Settings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Settings} Settings + */ + Settings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Settings) + return object; + var message = new $root.google.cloud.connectors.v1.Settings(); + if (object.name != null) + message.name = String(object.name); + if (object.vpcsc != null) + message.vpcsc = Boolean(object.vpcsc); + if (object.payg != null) + message.payg = Boolean(object.payg); + return message; + }; + + /** + * Creates a plain object from a Settings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {google.cloud.connectors.v1.Settings} message Settings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Settings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.vpcsc = false; + object.payg = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.vpcsc != null && message.hasOwnProperty("vpcsc")) + object.vpcsc = message.vpcsc; + if (message.payg != null && message.hasOwnProperty("payg")) + object.payg = message.payg; + return object; + }; + + /** + * Converts this Settings to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Settings + * @instance + * @returns {Object.} JSON object + */ + Settings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Settings + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Settings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Settings"; + }; + + return Settings; + })(); + + return v1; + })(); + + return connectors; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(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]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(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]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(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]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(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]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(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]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(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]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(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]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(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]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(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]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(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]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 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); + }; + + /** + * 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; + })(); + + 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 + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * 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 = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + 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; + } + case 13: { + message.edition = 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"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + object.edition = ""; + } + 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; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + 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); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + 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); + }; + + /** + * 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() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + 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) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === 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] === 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")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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 + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === 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")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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 + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + 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} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = 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 debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 18: { + message.target = 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 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.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"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + 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.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + 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) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + 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.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + 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: + 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; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("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")) + 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] === 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")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + 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); + }; + + /** + * 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 + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + 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); + }; + + /** + * 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; + })(); + + 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 {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @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 deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + 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 6: { + message.deprecatedLegacyJsonFieldConflicts = 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + 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; + object.deprecatedLegacyJsonFieldConflicts = 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + 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); + }; + + /** + * 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; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === 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) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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 + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + 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); + }; + + /** + * 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() { + + /** + * 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); + }; + + /** + * 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; + })(); + + 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); + }; + + /** + * 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() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + 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); + }; + + /** + * 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() { + + /** + * 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 + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * 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; + + /** + * 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 + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + 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; + } + case 5: { + message.semantic = 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"; + 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; + }; + + /** + * 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; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + 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; + }; + + /** + * 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; + object.semantic = options.enums === String ? "NONE" : 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; + if (message.semantic != null && message.hasOwnProperty("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; + }; + + /** + * 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); + }; + + /** + * 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; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function 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.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(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]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function 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.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function 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.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + 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); + }; + + /** + * 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; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-connectors/protos/protos.json b/packages/google-cloud-connectors/protos/protos.json new file mode 100644 index 00000000000..e1fba014d95 --- /dev/null +++ b/packages/google-cloud-connectors/protos/protos.json @@ -0,0 +1,4044 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "connectors": { + "nested": { + "v1": { + "options": { + "go_package": "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb", + "java_multiple_files": true, + "java_outer_classname": "SettingsProto", + "java_package": "com.google.cloud.connectors.v1" + }, + "nested": { + "AuthConfig": { + "oneofs": { + "type": { + "oneof": [ + "userPassword", + "oauth2JwtBearer", + "oauth2ClientCredentials", + "sshPublicKey" + ] + } + }, + "fields": { + "authType": { + "type": "AuthType", + "id": 1 + }, + "userPassword": { + "type": "UserPassword", + "id": 2 + }, + "oauth2JwtBearer": { + "type": "Oauth2JwtBearer", + "id": 3 + }, + "oauth2ClientCredentials": { + "type": "Oauth2ClientCredentials", + "id": 4 + }, + "sshPublicKey": { + "type": "SshPublicKey", + "id": 6 + }, + "additionalVariables": { + "rule": "repeated", + "type": "ConfigVariable", + "id": 5 + } + }, + "nested": { + "UserPassword": { + "fields": { + "username": { + "type": "string", + "id": 1 + }, + "password": { + "type": "Secret", + "id": 2 + } + } + }, + "Oauth2JwtBearer": { + "fields": { + "clientKey": { + "type": "Secret", + "id": 1 + }, + "jwtClaims": { + "type": "JwtClaims", + "id": 2 + } + }, + "nested": { + "JwtClaims": { + "fields": { + "issuer": { + "type": "string", + "id": 1 + }, + "subject": { + "type": "string", + "id": 2 + }, + "audience": { + "type": "string", + "id": 3 + } + } + } + } + }, + "Oauth2ClientCredentials": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + }, + "clientSecret": { + "type": "Secret", + "id": 2 + } + } + }, + "SshPublicKey": { + "fields": { + "username": { + "type": "string", + "id": 1 + }, + "sshClientCert": { + "type": "Secret", + "id": 3 + }, + "certType": { + "type": "string", + "id": 4 + }, + "sshClientCertPass": { + "type": "Secret", + "id": 5 + } + } + } + } + }, + "AuthConfigTemplate": { + "fields": { + "authType": { + "type": "AuthType", + "id": 1 + }, + "configVariableTemplates": { + "rule": "repeated", + "type": "ConfigVariableTemplate", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + } + } + }, + "AuthType": { + "values": { + "AUTH_TYPE_UNSPECIFIED": 0, + "USER_PASSWORD": 1, + "OAUTH2_JWT_BEARER": 2, + "OAUTH2_CLIENT_CREDENTIALS": 3, + "SSH_PUBLIC_KEY": 4, + "OAUTH2_AUTH_CODE_FLOW": 5 + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ConfigVariableTemplate": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "valueType": { + "type": "ValueType", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + }, + "validationRegex": { + "type": "string", + "id": 5 + }, + "required": { + "type": "bool", + "id": 6 + }, + "roleGrant": { + "type": "RoleGrant", + "id": 7 + }, + "enumOptions": { + "rule": "repeated", + "type": "EnumOption", + "id": 8 + }, + "authorizationCodeLink": { + "type": "AuthorizationCodeLink", + "id": 9 + }, + "state": { + "type": "State", + "id": 10 + }, + "isAdvanced": { + "type": "bool", + "id": 11 + } + }, + "nested": { + "ValueType": { + "values": { + "VALUE_TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INT": 2, + "BOOL": 3, + "SECRET": 4, + "ENUM": 5, + "AUTHORIZATION_CODE": 6 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "DEPRECATED": 2 + } + } + } + }, + "Secret": { + "fields": { + "secretVersion": { + "type": "string", + "id": 1 + } + } + }, + "EnumOption": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + } + } + }, + "ConfigVariable": { + "oneofs": { + "value": { + "oneof": [ + "intValue", + "boolValue", + "stringValue", + "secretValue" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "intValue": { + "type": "int64", + "id": 2 + }, + "boolValue": { + "type": "bool", + "id": 3 + }, + "stringValue": { + "type": "string", + "id": 4 + }, + "secretValue": { + "type": "Secret", + "id": 5 + } + } + }, + "RoleGrant": { + "fields": { + "principal": { + "type": "Principal", + "id": 1 + }, + "roles": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "helperTextTemplate": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Principal": { + "values": { + "PRINCIPAL_UNSPECIFIED": 0, + "CONNECTOR_SA": 1 + } + }, + "Resource": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "pathTemplate": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "GCP_PROJECT": 1, + "GCP_RESOURCE": 2, + "GCP_SECRETMANAGER_SECRET": 3, + "GCP_SECRETMANAGER_SECRET_VERSION": 4 + } + } + } + } + } + }, + "AuthorizationCodeLink": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "clientId": { + "type": "string", + "id": 3 + }, + "enablePkce": { + "type": "bool", + "id": 4 + } + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "PREVIEW": 1, + "GA": 2, + "DEPRECATED": 3, + "PRIVATE_PREVIEW": 5 + } + }, + "Connection": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/Connection", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/connections/{connection}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectorVersion": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/ConnectorVersion" + } + }, + "status": { + "type": "ConnectionStatus", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "configVariables": { + "rule": "repeated", + "type": "ConfigVariable", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "authConfig": { + "type": "AuthConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lockConfig": { + "type": "LockConfig", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "destinationConfigs": { + "rule": "repeated", + "type": "DestinationConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "imageLocation": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceAccount": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectory": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "envoyImageLocation": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "suspended": { + "type": "bool", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeConfig": { + "type": "NodeConfig", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sslConfig": { + "type": "SslConfig", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "NodeConfig": { + "fields": { + "minNodeCount": { + "type": "int32", + "id": 1 + }, + "maxNodeCount": { + "type": "int32", + "id": 2 + } + } + }, + "ConnectionSchemaMetadata": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/ConnectionSchemaMetadata", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata" + }, + "fields": { + "entities": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "actions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "refreshTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "REFRESHING": 1, + "UPDATED": 2 + } + } + } + }, + "RuntimeEntitySchema": { + "fields": { + "entity": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "fields": { + "rule": "repeated", + "type": "Field", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Field": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "dataType": { + "type": "DataType", + "id": 3 + }, + "key": { + "type": "bool", + "id": 4 + }, + "readonly": { + "type": "bool", + "id": 5 + }, + "nullable": { + "type": "bool", + "id": 6 + }, + "defaultValue": { + "type": "google.protobuf.Value", + "id": 7 + }, + "additionalDetails": { + "type": "google.protobuf.Struct", + "id": 8 + } + } + } + } + }, + "RuntimeActionSchema": { + "fields": { + "action": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputParameters": { + "rule": "repeated", + "type": "InputParameter", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resultMetadata": { + "rule": "repeated", + "type": "ResultMetadata", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "InputParameter": { + "fields": { + "parameter": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "dataType": { + "type": "DataType", + "id": 3 + }, + "nullable": { + "type": "bool", + "id": 4 + }, + "defaultValue": { + "type": "google.protobuf.Value", + "id": 5 + } + } + }, + "ResultMetadata": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "dataType": { + "type": "DataType", + "id": 3 + } + } + } + } + }, + "LockConfig": { + "fields": { + "locked": { + "type": "bool", + "id": 1 + }, + "reason": { + "type": "string", + "id": 2 + } + } + }, + "ListConnectionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "connectors.googleapis.com/Connection" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + }, + "view": { + "type": "ConnectionView", + "id": 6 + } + } + }, + "ListConnectionsResponse": { + "fields": { + "connections": { + "rule": "repeated", + "type": "Connection", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetConnectionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connection" + } + }, + "view": { + "type": "ConnectionView", + "id": 2 + } + } + }, + "CreateConnectionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "connectors.googleapis.com/Connection" + } + }, + "connectionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "connection": { + "type": "Connection", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateConnectionRequest": { + "fields": { + "connection": { + "type": "Connection", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteConnectionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connection" + } + } + } + }, + "GetConnectionSchemaMetadataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/ConnectionSchemaMetadata" + } + } + } + }, + "RefreshConnectionSchemaMetadataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/ConnectionSchemaMetadata" + } + } + } + }, + "ListRuntimeEntitySchemasRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connection" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRuntimeEntitySchemasResponse": { + "fields": { + "runtimeEntitySchemas": { + "rule": "repeated", + "type": "RuntimeEntitySchema", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListRuntimeActionSchemasRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connection" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRuntimeActionSchemasResponse": { + "fields": { + "runtimeActionSchemas": { + "rule": "repeated", + "type": "RuntimeActionSchema", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ConnectionStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "status": { + "type": "string", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "INACTIVE": 3, + "DELETING": 4, + "UPDATING": 5, + "ERROR": 6, + "AUTHORIZATION_REQUIRED": 7 + } + } + } + }, + "DataType": { + "valuesOptions": { + "DATA_TYPE_INT": { + "deprecated": true + }, + "DATA_TYPE_DATETIME": { + "deprecated": true + }, + "DATA_TYPE_STRING": { + "deprecated": true + }, + "DATA_TYPE_LONG": { + "deprecated": true + }, + "DATA_TYPE_UUID": { + "deprecated": true + } + }, + "values": { + "DATA_TYPE_UNSPECIFIED": 0, + "DATA_TYPE_INT": 1, + "DATA_TYPE_SMALLINT": 2, + "DATA_TYPE_DOUBLE": 3, + "DATA_TYPE_DATE": 4, + "DATA_TYPE_DATETIME": 5, + "DATA_TYPE_TIME": 6, + "DATA_TYPE_STRING": 7, + "DATA_TYPE_LONG": 8, + "DATA_TYPE_BOOLEAN": 9, + "DATA_TYPE_DECIMAL": 10, + "DATA_TYPE_UUID": 11, + "DATA_TYPE_BLOB": 12, + "DATA_TYPE_BIT": 13, + "DATA_TYPE_TINYINT": 14, + "DATA_TYPE_INTEGER": 15, + "DATA_TYPE_BIGINT": 16, + "DATA_TYPE_FLOAT": 17, + "DATA_TYPE_REAL": 18, + "DATA_TYPE_NUMERIC": 19, + "DATA_TYPE_CHAR": 20, + "DATA_TYPE_VARCHAR": 21, + "DATA_TYPE_LONGVARCHAR": 22, + "DATA_TYPE_TIMESTAMP": 23, + "DATA_TYPE_NCHAR": 24, + "DATA_TYPE_NVARCHAR": 25, + "DATA_TYPE_LONGNVARCHAR": 26, + "DATA_TYPE_NULL": 27, + "DATA_TYPE_OTHER": 28, + "DATA_TYPE_JAVA_OBJECT": 29, + "DATA_TYPE_DISTINCT": 30, + "DATA_TYPE_STRUCT": 31, + "DATA_TYPE_ARRAY": 32, + "DATA_TYPE_CLOB": 33, + "DATA_TYPE_REF": 34, + "DATA_TYPE_DATALINK": 35, + "DATA_TYPE_ROWID": 36, + "DATA_TYPE_BINARY": 37, + "DATA_TYPE_VARBINARY": 38, + "DATA_TYPE_LONGVARBINARY": 39, + "DATA_TYPE_NCLOB": 40, + "DATA_TYPE_SQLXML": 41, + "DATA_TYPE_REF_CURSOR": 42, + "DATA_TYPE_TIME_WITH_TIMEZONE": 43, + "DATA_TYPE_TIMESTAMP_WITH_TIMEZONE": 44 + } + }, + "ConnectionView": { + "values": { + "CONNECTION_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + }, + "DestinationConfig": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "destinations": { + "rule": "repeated", + "type": "Destination", + "id": 2 + } + } + }, + "Destination": { + "oneofs": { + "destination": { + "oneof": [ + "serviceAttachment", + "host" + ] + } + }, + "fields": { + "serviceAttachment": { + "type": "string", + "id": 1 + }, + "host": { + "type": "string", + "id": 2 + }, + "port": { + "type": "int32", + "id": 3 + } + } + }, + "SslConfigTemplate": { + "fields": { + "sslType": { + "type": "SslType", + "id": 1 + }, + "isTlsMandatory": { + "type": "bool", + "id": 2 + }, + "serverCertType": { + "rule": "repeated", + "type": "CertType", + "id": 3 + }, + "clientCertType": { + "rule": "repeated", + "type": "CertType", + "id": 4 + }, + "additionalVariables": { + "rule": "repeated", + "type": "ConfigVariableTemplate", + "id": 5 + } + } + }, + "SslConfig": { + "fields": { + "type": { + "type": "SslType", + "id": 1 + }, + "trustModel": { + "type": "TrustModel", + "id": 2 + }, + "privateServerCertificate": { + "type": "Secret", + "id": 3 + }, + "clientCertificate": { + "type": "Secret", + "id": 4 + }, + "clientPrivateKey": { + "type": "Secret", + "id": 5 + }, + "clientPrivateKeyPass": { + "type": "Secret", + "id": 6 + }, + "serverCertType": { + "type": "CertType", + "id": 7 + }, + "clientCertType": { + "type": "CertType", + "id": 8 + }, + "useSsl": { + "type": "bool", + "id": 9 + }, + "additionalVariables": { + "rule": "repeated", + "type": "ConfigVariable", + "id": 10 + } + }, + "nested": { + "TrustModel": { + "values": { + "PUBLIC": 0, + "PRIVATE": 1, + "INSECURE": 2 + } + } + } + }, + "SslType": { + "values": { + "SSL_TYPE_UNSPECIFIED": 0, + "TLS": 1, + "MTLS": 2 + } + }, + "CertType": { + "values": { + "CERT_TYPE_UNSPECIFIED": 0, + "PEM": 1 + } + }, + "Connector": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/Connector", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentationUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalUri": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "webAssetsLocation": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "launchStage": { + "type": "LaunchStage", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetConnectorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connector" + } + } + } + }, + "ListConnectorsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Provider" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListConnectorsResponse": { + "fields": { + "connectors": { + "rule": "repeated", + "type": "Connector", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ConnectorVersion": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/ConnectorVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}/versions/{version}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "launchStage": { + "type": "LaunchStage", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "releaseVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "authConfigTemplates": { + "rule": "repeated", + "type": "AuthConfigTemplate", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "configVariableTemplates": { + "rule": "repeated", + "type": "ConfigVariableTemplate", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "supportedRuntimeFeatures": { + "type": "SupportedRuntimeFeatures", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "egressControlConfig": { + "type": "EgressControlConfig", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "roleGrants": { + "rule": "repeated", + "type": "RoleGrant", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "roleGrant": { + "type": "RoleGrant", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sslConfigTemplate": { + "type": "SslConfigTemplate", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetConnectorVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/ConnectorVersion" + } + }, + "view": { + "type": "ConnectorVersionView", + "id": 2 + } + } + }, + "ListConnectorVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connector" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "view": { + "type": "ConnectorVersionView", + "id": 4 + } + } + }, + "ListConnectorVersionsResponse": { + "fields": { + "connectorVersions": { + "rule": "repeated", + "type": "ConnectorVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "SupportedRuntimeFeatures": { + "fields": { + "entityApis": { + "type": "bool", + "id": 1 + }, + "actionApis": { + "type": "bool", + "id": 2 + }, + "sqlQuery": { + "type": "bool", + "id": 3 + } + } + }, + "EgressControlConfig": { + "oneofs": { + "oneofBackends": { + "oneof": [ + "backends", + "extractionRules" + ] + } + }, + "fields": { + "backends": { + "type": "string", + "id": 1 + }, + "extractionRules": { + "type": "ExtractionRules", + "id": 2 + } + } + }, + "ExtractionRules": { + "fields": { + "extractionRule": { + "rule": "repeated", + "type": "ExtractionRule", + "id": 1 + } + } + }, + "ExtractionRule": { + "fields": { + "source": { + "type": "Source", + "id": 1 + }, + "extractionRegex": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Source": { + "fields": { + "sourceType": { + "type": "SourceType", + "id": 1 + }, + "fieldId": { + "type": "string", + "id": 2 + } + } + }, + "SourceType": { + "values": { + "SOURCE_TYPE_UNSPECIFIED": 0, + "CONFIG_VARIABLE": 1 + } + } + } + }, + "ConnectorVersionView": { + "values": { + "CONNECTOR_VERSION_VIEW_UNSPECIFIED": 0, + "CONNECTOR_VERSION_VIEW_BASIC": 1, + "CONNECTOR_VERSION_VIEW_FULL": 2 + } + }, + "Connectors": { + "options": { + "(google.api.default_host)": "connectors.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListConnections": { + "requestType": "ListConnectionsRequest", + "responseType": "ListConnectionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/connections", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/connections" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnection": { + "requestType": "GetConnectionRequest", + "responseType": "Connection", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/connections/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/connections/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateConnection": { + "requestType": "CreateConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/connections", + "(google.api.http).body": "connection", + "(google.api.method_signature)": "parent,connection,connection_id", + "(google.longrunning.operation_info).response_type": "Connection", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/connections", + "body": "connection" + } + }, + { + "(google.api.method_signature)": "parent,connection,connection_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Connection", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateConnection": { + "requestType": "UpdateConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{connection.name=projects/*/locations/*/connections/*}", + "(google.api.http).body": "connection", + "(google.api.method_signature)": "connection,update_mask", + "(google.longrunning.operation_info).response_type": "Connection", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{connection.name=projects/*/locations/*/connections/*}", + "body": "connection" + } + }, + { + "(google.api.method_signature)": "connection,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Connection", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteConnection": { + "requestType": "DeleteConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/connections/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/connections/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListProviders": { + "requestType": "ListProvidersRequest", + "responseType": "ListProvidersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/providers", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/providers" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetProvider": { + "requestType": "GetProviderRequest", + "responseType": "Provider", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/providers/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/providers/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListConnectors": { + "requestType": "ListConnectorsRequest", + "responseType": "ListConnectorsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/providers/*}/connectors", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/providers/*}/connectors" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnector": { + "requestType": "GetConnectorRequest", + "responseType": "Connector", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/providers/*/connectors/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/providers/*/connectors/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListConnectorVersions": { + "requestType": "ListConnectorVersionsRequest", + "responseType": "ListConnectorVersionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/providers/*/connectors/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/providers/*/connectors/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnectorVersion": { + "requestType": "GetConnectorVersionRequest", + "responseType": "ConnectorVersion", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/providers/*/connectors/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/providers/*/connectors/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetConnectionSchemaMetadata": { + "requestType": "GetConnectionSchemaMetadataRequest", + "responseType": "ConnectionSchemaMetadata", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RefreshConnectionSchemaMetadata": { + "requestType": "RefreshConnectionSchemaMetadataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}:refresh", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "ConnectionSchemaMetadata", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}:refresh", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConnectionSchemaMetadata", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListRuntimeEntitySchemas": { + "requestType": "ListRuntimeEntitySchemasRequest", + "responseType": "ListRuntimeEntitySchemasResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/connections/*}/runtimeEntitySchemas", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/connections/*}/runtimeEntitySchemas" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListRuntimeActionSchemas": { + "requestType": "ListRuntimeActionSchemasRequest", + "responseType": "ListRuntimeActionSchemasResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/connections/*}/runtimeActionSchemas", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/connections/*}/runtimeActionSchemas" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetRuntimeConfig": { + "requestType": "GetRuntimeConfigRequest", + "responseType": "RuntimeConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/runtimeConfig}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/runtimeConfig}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetGlobalSettings": { + "requestType": "GetGlobalSettingsRequest", + "responseType": "Settings", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/global/settings}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/global/settings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Provider": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/Provider", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/providers/{provider}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentationUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalUri": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "webAssetsLocation": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "launchStage": { + "type": "LaunchStage", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetProviderRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Provider" + } + } + } + }, + "ListProvidersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "connectors.googleapis.com/Provider" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProvidersResponse": { + "fields": { + "providers": { + "rule": "repeated", + "type": "Provider", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetRuntimeConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/RuntimeConfig" + } + } + } + }, + "RuntimeConfig": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/RuntimeConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/runtimeConfig" + }, + "fields": { + "locationId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conndTopic": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conndSubscription": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "controlPlaneTopic": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "controlPlaneSubscription": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "runtimeEndpoint": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "schemaGcsBucket": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceDirectory": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "valuesOptions": { + "INACTIVE": { + "deprecated": true + }, + "ACTIVATING": { + "deprecated": true + } + }, + "values": { + "STATE_UNSPECIFIED": 0, + "INACTIVE": 1, + "ACTIVATING": 2, + "ACTIVE": 3, + "CREATING": 4, + "DELETING": 5, + "UPDATING": 6 + } + } + } + }, + "GetGlobalSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Settings" + } + } + } + }, + "Settings": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/Settings", + "(google.api.resource).pattern": "projects/{project}/locations/global/settings" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vpcsc": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "payg": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "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, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 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 + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "target": { + "type": "OptionTargetType", + "id": 18 + }, + "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 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + } + } + }, + "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 + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "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 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-connectors/samples/README.md b/packages/google-cloud-connectors/samples/README.md new file mode 100644 index 00000000000..6665d886a7a --- /dev/null +++ b/packages/google-cloud-connectors/samples/README.md @@ -0,0 +1,356 @@ +[//]: # "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 + +# [Connectors API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Connectors.create_connection](#connectors.create_connection) + * [Connectors.delete_connection](#connectors.delete_connection) + * [Connectors.get_connection](#connectors.get_connection) + * [Connectors.get_connection_schema_metadata](#connectors.get_connection_schema_metadata) + * [Connectors.get_connector](#connectors.get_connector) + * [Connectors.get_connector_version](#connectors.get_connector_version) + * [Connectors.get_global_settings](#connectors.get_global_settings) + * [Connectors.get_provider](#connectors.get_provider) + * [Connectors.get_runtime_config](#connectors.get_runtime_config) + * [Connectors.list_connections](#connectors.list_connections) + * [Connectors.list_connector_versions](#connectors.list_connector_versions) + * [Connectors.list_connectors](#connectors.list_connectors) + * [Connectors.list_providers](#connectors.list_providers) + * [Connectors.list_runtime_action_schemas](#connectors.list_runtime_action_schemas) + * [Connectors.list_runtime_entity_schemas](#connectors.list_runtime_entity_schemas) + * [Connectors.refresh_connection_schema_metadata](#connectors.refresh_connection_schema_metadata) + * [Connectors.update_connection](#connectors.update_connection) + * [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/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Connectors.create_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js` + + +----- + + + + +### Connectors.delete_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js` + + +----- + + + + +### Connectors.get_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js` + + +----- + + + + +### Connectors.get_connection_schema_metadata + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js` + + +----- + + + + +### Connectors.get_connector + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js` + + +----- + + + + +### Connectors.get_connector_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js` + + +----- + + + + +### Connectors.get_global_settings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js` + + +----- + + + + +### Connectors.get_provider + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js` + + +----- + + + + +### Connectors.get_runtime_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js` + + +----- + + + + +### Connectors.list_connections + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js` + + +----- + + + + +### Connectors.list_connector_versions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js` + + +----- + + + + +### Connectors.list_connectors + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js` + + +----- + + + + +### Connectors.list_providers + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js` + + +----- + + + + +### Connectors.list_runtime_action_schemas + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js` + + +----- + + + + +### Connectors.list_runtime_entity_schemas + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js` + + +----- + + + + +### Connectors.refresh_connection_schema_metadata + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js` + + +----- + + + + +### Connectors.update_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-connectors/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/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/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js new file mode 100644 index 00000000000..c6d7fe861cb --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, connectionId, connection) { + // [START connectors_v1_generated_Connectors_CreateConnection_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Required. Identifier to assign to the Connection. Must be unique within + * scope of the parent resource. + */ + // const connectionId = 'abc123' + /** + * Required. Connection resource. + */ + // const connection = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callCreateConnection() { + // Construct request + const request = { + parent, + connectionId, + connection, + }; + + // Run request + const [operation] = await connectorsClient.createConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateConnection(); + // [END connectors_v1_generated_Connectors_CreateConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js new file mode 100644 index 00000000000..36cd11e8439 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START connectors_v1_generated_Connectors_DeleteConnection_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the form: + * `projects/* /locations/* /connections/*` + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callDeleteConnection() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await connectorsClient.deleteConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteConnection(); + // [END connectors_v1_generated_Connectors_DeleteConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js new file mode 100644 index 00000000000..4da725507f2 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START connectors_v1_generated_Connectors_GetConnection_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the form: + * `projects/* /locations/* /connections/*` + */ + // const name = 'abc123' + /** + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + */ + // const view = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetConnection() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getConnection(request); + console.log(response); + } + + callGetConnection(); + // [END connectors_v1_generated_Connectors_GetConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js new file mode 100644 index 00000000000..c64889ac5f8 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START connectors_v1_generated_Connectors_GetConnectionSchemaMetadata_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Connection name + * Format: + * projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetConnectionSchemaMetadata() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getConnectionSchemaMetadata(request); + console.log(response); + } + + callGetConnectionSchemaMetadata(); + // [END connectors_v1_generated_Connectors_GetConnectionSchemaMetadata_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js new file mode 100644 index 00000000000..03efc2f445c --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START connectors_v1_generated_Connectors_GetConnector_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for Connector resource. + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetConnector() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getConnector(request); + console.log(response); + } + + callGetConnector(); + // [END connectors_v1_generated_Connectors_GetConnector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js new file mode 100644 index 00000000000..e90bd2d661f --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START connectors_v1_generated_Connectors_GetConnectorVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the form: + * `projects/* /locations/* /providers/* /connectors/* /versions/*` + * Only global location is supported for ConnectorVersion resource. + */ + // const name = 'abc123' + /** + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `CUSTOMER` view. + */ + // const view = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetConnectorVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getConnectorVersion(request); + console.log(response); + } + + callGetConnectorVersion(); + // [END connectors_v1_generated_Connectors_GetConnectorVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js new file mode 100644 index 00000000000..4ed3eee53d5 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START connectors_v1_generated_Connectors_GetGlobalSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Settings. + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetGlobalSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getGlobalSettings(request); + console.log(response); + } + + callGetGlobalSettings(); + // [END connectors_v1_generated_Connectors_GetGlobalSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js new file mode 100644 index 00000000000..ec599e855a9 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START connectors_v1_generated_Connectors_GetProvider_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Provider resource. + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetProvider() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getProvider(request); + console.log(response); + } + + callGetProvider(); + // [END connectors_v1_generated_Connectors_GetProvider_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js new file mode 100644 index 00000000000..3266bb68b14 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START connectors_v1_generated_Connectors_GetRuntimeConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the form: + * `projects/* /locations/* /runtimeConfig` + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetRuntimeConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getRuntimeConfig(request); + console.log(response); + } + + callGetRuntimeConfig(); + // [END connectors_v1_generated_Connectors_GetRuntimeConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js new file mode 100644 index 00000000000..feb26e3f100 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js @@ -0,0 +1,85 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START connectors_v1_generated_Connectors_ListConnections_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + /** + * Filter. + */ + // const filter = 'abc123' + /** + * Order by parameters. + */ + // const orderBy = 'abc123' + /** + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + */ + // const view = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListConnections() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listConnectionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConnections(); + // [END connectors_v1_generated_Connectors_ListConnections_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js new file mode 100644 index 00000000000..2b3ab0042e5 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js @@ -0,0 +1,78 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START connectors_v1_generated_Connectors_ListConnectorVersions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for ConnectorVersion resource. + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + /** + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `BASIC` view. + */ + // const view = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListConnectorVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listConnectorVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConnectorVersions(); + // [END connectors_v1_generated_Connectors_ListConnectorVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js new file mode 100644 index 00000000000..f96a2ac317f --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START connectors_v1_generated_Connectors_ListConnectors_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Connector resource. + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListConnectors() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listConnectorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConnectors(); + // [END connectors_v1_generated_Connectors_ListConnectors_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js new file mode 100644 index 00000000000..b1a45a781b7 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START connectors_v1_generated_Connectors_ListProviders_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource of the API, of the form: + * `projects/* /locations/*` + * Only global location is supported for Provider resource. + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListProviders() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listProvidersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProviders(); + // [END connectors_v1_generated_Connectors_ListProviders_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js new file mode 100644 index 00000000000..c26fca88836 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, filter) { + // [START connectors_v1_generated_Connectors_ListRuntimeActionSchemas_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource of RuntimeActionSchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + /** + * Required. Filter + * Format: + * action="{actionId}" + * Only action field is supported with literal equality operator. + * Accepted filter example: action="CancelOrder" + * Wildcards are not supported in the filter currently. + */ + // const filter = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListRuntimeActionSchemas() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = await connectorsClient.listRuntimeActionSchemasAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRuntimeActionSchemas(); + // [END connectors_v1_generated_Connectors_ListRuntimeActionSchemas_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js new file mode 100644 index 00000000000..ed743190002 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, filter) { + // [START connectors_v1_generated_Connectors_ListRuntimeEntitySchemas_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource of RuntimeEntitySchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + /** + * Required. Filter + * Format: + * entity="{entityId}" + * Only entity field is supported with literal equality operator. + * Accepted filter example: entity="Order" + * Wildcards are not supported in the filter currently. + */ + // const filter = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListRuntimeEntitySchemas() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = await connectorsClient.listRuntimeEntitySchemasAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRuntimeEntitySchemas(); + // [END connectors_v1_generated_Connectors_ListRuntimeEntitySchemas_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js new file mode 100644 index 00000000000..dee14288e82 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js @@ -0,0 +1,64 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START connectors_v1_generated_Connectors_RefreshConnectionSchemaMetadata_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name. + * Format: + * projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callRefreshConnectionSchemaMetadata() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await connectorsClient.refreshConnectionSchemaMetadata(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRefreshConnectionSchemaMetadata(); + // [END connectors_v1_generated_Connectors_RefreshConnectionSchemaMetadata_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js new file mode 100644 index 00000000000..0f156de4ad4 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js @@ -0,0 +1,79 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(connection, updateMask) { + // [START connectors_v1_generated_Connectors_UpdateConnection_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Connection resource. + */ + // const connection = {} + /** + * Required. You can modify only the fields listed below. + * To lock/unlock a connection: + * * `lock_config` + * To suspend/resume a connection: + * * `suspended` + * To update the connection details: + * * `description` + * * `labels` + * * `connector_version` + * * `config_variables` + * * `auth_config` + * * `destination_configs` + * * `node_config` + */ + // const updateMask = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callUpdateConnection() { + // Construct request + const request = { + connection, + updateMask, + }; + + // Run request + const [operation] = await connectorsClient.updateConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateConnection(); + // [END connectors_v1_generated_Connectors_UpdateConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/snippet_metadata_google.cloud.connectors.v1.json b/packages/google-cloud-connectors/samples/generated/v1/snippet_metadata_google.cloud.connectors.v1.json new file mode 100644 index 00000000000..11f46bf7978 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/snippet_metadata_google.cloud.connectors.v1.json @@ -0,0 +1,787 @@ +{ + "clientLibrary": { + "name": "nodejs-connectors", + "version": "0.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.connectors.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "connectors_v1_generated_Connectors_ListConnections_async", + "title": "Connectors listConnections Sample", + "origin": "API_DEFINITION", + "description": " Lists Connections in a given project and location.", + "canonical": true, + "file": "connectors.list_connections.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConnections", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnections", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.connectors.v1.ConnectionView" + } + ], + "resultType": ".google.cloud.connectors.v1.ListConnectionsResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListConnections", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnections", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetConnection_async", + "title": "Connectors getConnection Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Connection.", + "canonical": true, + "file": "connectors.get_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnection", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.connectors.v1.ConnectionView" + } + ], + "resultType": ".google.cloud.connectors.v1.Connection", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetConnection", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnection", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_CreateConnection_async", + "title": "Connectors createConnection Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Connection in a given project and location.", + "canonical": true, + "file": "connectors.create_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateConnection", + "fullName": "google.cloud.connectors.v1.Connectors.CreateConnection", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "connection_id", + "type": "TYPE_STRING" + }, + { + "name": "connection", + "type": ".google.cloud.connectors.v1.Connection" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "CreateConnection", + "fullName": "google.cloud.connectors.v1.Connectors.CreateConnection", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_UpdateConnection_async", + "title": "Connectors updateConnection Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Connection.", + "canonical": true, + "file": "connectors.update_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateConnection", + "fullName": "google.cloud.connectors.v1.Connectors.UpdateConnection", + "async": true, + "parameters": [ + { + "name": "connection", + "type": ".google.cloud.connectors.v1.Connection" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "UpdateConnection", + "fullName": "google.cloud.connectors.v1.Connectors.UpdateConnection", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_DeleteConnection_async", + "title": "Connectors deleteConnection Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Connection.", + "canonical": true, + "file": "connectors.delete_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConnection", + "fullName": "google.cloud.connectors.v1.Connectors.DeleteConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "DeleteConnection", + "fullName": "google.cloud.connectors.v1.Connectors.DeleteConnection", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_ListProviders_async", + "title": "Connectors listProviders Sample", + "origin": "API_DEFINITION", + "description": " Lists Providers in a given project and location.", + "canonical": true, + "file": "connectors.list_providers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProviders", + "fullName": "google.cloud.connectors.v1.Connectors.ListProviders", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.ListProvidersResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListProviders", + "fullName": "google.cloud.connectors.v1.Connectors.ListProviders", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetProvider_async", + "title": "Connectors getProvider Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a provider.", + "canonical": true, + "file": "connectors.get_provider.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProvider", + "fullName": "google.cloud.connectors.v1.Connectors.GetProvider", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.Provider", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetProvider", + "fullName": "google.cloud.connectors.v1.Connectors.GetProvider", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_ListConnectors_async", + "title": "Connectors listConnectors Sample", + "origin": "API_DEFINITION", + "description": " Lists Connectors in a given project and location.", + "canonical": true, + "file": "connectors.list_connectors.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConnectors", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnectors", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.ListConnectorsResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListConnectors", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnectors", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetConnector_async", + "title": "Connectors getConnector Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Connector.", + "canonical": true, + "file": "connectors.get_connector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnector", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnector", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.Connector", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetConnector", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnector", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_ListConnectorVersions_async", + "title": "Connectors listConnectorVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists Connector Versions in a given project and location.", + "canonical": true, + "file": "connectors.list_connector_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConnectorVersions", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnectorVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.connectors.v1.ConnectorVersionView" + } + ], + "resultType": ".google.cloud.connectors.v1.ListConnectorVersionsResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListConnectorVersions", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnectorVersions", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetConnectorVersion_async", + "title": "Connectors getConnectorVersion Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single connector version.", + "canonical": true, + "file": "connectors.get_connector_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnectorVersion", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnectorVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.connectors.v1.ConnectorVersionView" + } + ], + "resultType": ".google.cloud.connectors.v1.ConnectorVersion", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetConnectorVersion", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnectorVersion", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetConnectionSchemaMetadata_async", + "title": "Connectors getConnectionSchemaMetadata Sample", + "origin": "API_DEFINITION", + "description": " Gets schema metadata of a connection. SchemaMetadata is a singleton resource for each connection.", + "canonical": true, + "file": "connectors.get_connection_schema_metadata.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnectionSchemaMetadata", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnectionSchemaMetadata", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.ConnectionSchemaMetadata", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetConnectionSchemaMetadata", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnectionSchemaMetadata", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_RefreshConnectionSchemaMetadata_async", + "title": "Connectors refreshConnectionSchemaMetadata Sample", + "origin": "API_DEFINITION", + "description": " Refresh runtime schema of a connection.", + "canonical": true, + "file": "connectors.refresh_connection_schema_metadata.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RefreshConnectionSchemaMetadata", + "fullName": "google.cloud.connectors.v1.Connectors.RefreshConnectionSchemaMetadata", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "RefreshConnectionSchemaMetadata", + "fullName": "google.cloud.connectors.v1.Connectors.RefreshConnectionSchemaMetadata", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_ListRuntimeEntitySchemas_async", + "title": "Connectors listRuntimeEntitySchemas Sample", + "origin": "API_DEFINITION", + "description": " List schema of a runtime entities filtered by entity name.", + "canonical": true, + "file": "connectors.list_runtime_entity_schemas.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRuntimeEntitySchemas", + "fullName": "google.cloud.connectors.v1.Connectors.ListRuntimeEntitySchemas", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListRuntimeEntitySchemas", + "fullName": "google.cloud.connectors.v1.Connectors.ListRuntimeEntitySchemas", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_ListRuntimeActionSchemas_async", + "title": "Connectors listRuntimeActionSchemas Sample", + "origin": "API_DEFINITION", + "description": " List schema of a runtime actions filtered by action name.", + "canonical": true, + "file": "connectors.list_runtime_action_schemas.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRuntimeActionSchemas", + "fullName": "google.cloud.connectors.v1.Connectors.ListRuntimeActionSchemas", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.ListRuntimeActionSchemasResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListRuntimeActionSchemas", + "fullName": "google.cloud.connectors.v1.Connectors.ListRuntimeActionSchemas", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetRuntimeConfig_async", + "title": "Connectors getRuntimeConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets the runtimeConfig of a location. RuntimeConfig is a singleton resource for each location.", + "canonical": true, + "file": "connectors.get_runtime_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRuntimeConfig", + "fullName": "google.cloud.connectors.v1.Connectors.GetRuntimeConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.RuntimeConfig", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetRuntimeConfig", + "fullName": "google.cloud.connectors.v1.Connectors.GetRuntimeConfig", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetGlobalSettings_async", + "title": "Connectors getGlobalSettings Sample", + "origin": "API_DEFINITION", + "description": " GetGlobalSettings gets settings of a project. GlobalSettings is a singleton resource.", + "canonical": true, + "file": "connectors.get_global_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGlobalSettings", + "fullName": "google.cloud.connectors.v1.Connectors.GetGlobalSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.Settings", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetGlobalSettings", + "fullName": "google.cloud.connectors.v1.Connectors.GetGlobalSettings", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-connectors/samples/package.json b/packages/google-cloud-connectors/samples/package.json new file mode 100644 index 00000000000..4b70d73dea3 --- /dev/null +++ b/packages/google-cloud-connectors/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "connectors-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@google-cloud/connectors": "0.0.0" + }, + "devDependencies": { + "c8": "^8.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-connectors/samples/quickstart.js b/packages/google-cloud-connectors/samples/quickstart.js new file mode 100644 index 00000000000..9fd14a90d68 --- /dev/null +++ b/packages/google-cloud-connectors/samples/quickstart.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +function main(parent) { + // [START connectors_quickstart] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + /** + * Filter. + */ + // const filter = 'abc123' + /** + * Order by parameters. + */ + // const orderBy = 'abc123' + /** + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + */ + // const view = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListConnections() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listConnectionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConnections(); + // [END connectors_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/test/quickstart.js b/packages/google-cloud-connectors/samples/test/quickstart.js new file mode 100644 index 00000000000..c89d0c0db5f --- /dev/null +++ b/packages/google-cloud-connectors/samples/test/quickstart.js @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +const {ConnectorsClient} = require('@google-cloud/connectors').v1; +const connectorsClient = new ConnectorsClient(); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await connectorsClient.getProjectId(); + }); + + it('should run quickstart', async () => { + const output = execSync( + `node ./quickstart.js projects/${projectId}/locations/global`, + {cwd} + ); + assert(output !== null); + }); +}); diff --git a/packages/google-cloud-connectors/src/index.ts b/packages/google-cloud-connectors/src/index.ts new file mode 100644 index 00000000000..5d37ce824af --- /dev/null +++ b/packages/google-cloud-connectors/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const ConnectorsClient = v1.ConnectorsClient; +type ConnectorsClient = v1.ConnectorsClient; + +export {v1, ConnectorsClient}; +export default {v1, ConnectorsClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-connectors/src/v1/connectors_client.ts b/packages/google-cloud-connectors/src/v1/connectors_client.ts new file mode 100644 index 00000000000..d36e86d4773 --- /dev/null +++ b/packages/google-cloud-connectors/src/v1/connectors_client.ts @@ -0,0 +1,3785 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/connectors_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './connectors_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Connectors is the interface for managing Connectors. + * @class + * @memberof v1 + */ +export class ConnectorsClient { + 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: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + connectorsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ConnectorsClient. + * + * @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/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 ConnectorsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ConnectorsClient; + 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 = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // 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; + } + + // 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 ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + connectionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/connections/{connection}' + ), + connectionSchemaMetadataPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata' + ), + connectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}' + ), + connectorVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}/versions/{version}' + ), + providerPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/providers/{provider}' + ), + runtimeConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeConfig' + ), + settingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/global/settings' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listConnections: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'connections' + ), + listProviders: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'providers' + ), + listConnectors: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'connectors' + ), + listConnectorVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'connectorVersions' + ), + listRuntimeEntitySchemas: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'runtimeEntitySchemas' + ), + listRuntimeActionSchemas: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'runtimeActionSchemas' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/connections/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/providers/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/connections/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/providers/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/connections/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/providers/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createConnectionResponse = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.Connection' + ) as gax.protobuf.Type; + const createConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateConnectionResponse = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.Connection' + ) as gax.protobuf.Type; + const updateConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteConnectionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.OperationMetadata' + ) as gax.protobuf.Type; + const refreshConnectionSchemaMetadataResponse = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.ConnectionSchemaMetadata' + ) as gax.protobuf.Type; + const refreshConnectionSchemaMetadataMetadata = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createConnectionResponse.decode.bind(createConnectionResponse), + createConnectionMetadata.decode.bind(createConnectionMetadata) + ), + updateConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateConnectionResponse.decode.bind(updateConnectionResponse), + updateConnectionMetadata.decode.bind(updateConnectionMetadata) + ), + deleteConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteConnectionResponse.decode.bind(deleteConnectionResponse), + deleteConnectionMetadata.decode.bind(deleteConnectionMetadata) + ), + refreshConnectionSchemaMetadata: + new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + refreshConnectionSchemaMetadataResponse.decode.bind( + refreshConnectionSchemaMetadataResponse + ), + refreshConnectionSchemaMetadataMetadata.decode.bind( + refreshConnectionSchemaMetadataMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.connectors.v1.Connectors', + 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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * 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.connectorsStub) { + return this.connectorsStub; + } + + // Put together the "service stub" for + // google.cloud.connectors.v1.Connectors. + this.connectorsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.connectors.v1.Connectors' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.connectors.v1.Connectors, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const connectorsStubMethods = [ + 'listConnections', + 'getConnection', + 'createConnection', + 'updateConnection', + 'deleteConnection', + 'listProviders', + 'getProvider', + 'listConnectors', + 'getConnector', + 'listConnectorVersions', + 'getConnectorVersion', + 'getConnectionSchemaMetadata', + 'refreshConnectionSchemaMetadata', + 'listRuntimeEntitySchemas', + 'listRuntimeActionSchemas', + 'getRuntimeConfig', + 'getGlobalSettings', + ]; + for (const methodName of connectorsStubMethods) { + const callPromise = this.connectorsStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.connectorsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'connectors.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'connectors.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets details of a single Connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /connections/*` + * @param {google.cloud.connectors.v1.ConnectionView} request.view + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.connectors.v1.Connection|Connection}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.get_connection.js + * region_tag:connectors_v1_generated_Connectors_GetConnection_async + */ + getConnection( + request?: protos.google.cloud.connectors.v1.IGetConnectionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IGetConnectionRequest | undefined, + {} | undefined, + ] + >; + getConnection( + request: protos.google.cloud.connectors.v1.IGetConnectionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IConnection, + | protos.google.cloud.connectors.v1.IGetConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnection( + request: protos.google.cloud.connectors.v1.IGetConnectionRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IConnection, + | protos.google.cloud.connectors.v1.IGetConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnection( + request?: protos.google.cloud.connectors.v1.IGetConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IConnection, + | protos.google.cloud.connectors.v1.IGetConnectionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IConnection, + | protos.google.cloud.connectors.v1.IGetConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IGetConnectionRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getConnection(request, options, callback); + } + /** + * Gets details of a provider. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Provider resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.connectors.v1.Provider|Provider}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.get_provider.js + * region_tag:connectors_v1_generated_Connectors_GetProvider_async + */ + getProvider( + request?: protos.google.cloud.connectors.v1.IGetProviderRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IProvider, + protos.google.cloud.connectors.v1.IGetProviderRequest | undefined, + {} | undefined, + ] + >; + getProvider( + request: protos.google.cloud.connectors.v1.IGetProviderRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IProvider, + protos.google.cloud.connectors.v1.IGetProviderRequest | null | undefined, + {} | null | undefined + > + ): void; + getProvider( + request: protos.google.cloud.connectors.v1.IGetProviderRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IProvider, + protos.google.cloud.connectors.v1.IGetProviderRequest | null | undefined, + {} | null | undefined + > + ): void; + getProvider( + request?: protos.google.cloud.connectors.v1.IGetProviderRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IProvider, + | protos.google.cloud.connectors.v1.IGetProviderRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IProvider, + protos.google.cloud.connectors.v1.IGetProviderRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IProvider, + protos.google.cloud.connectors.v1.IGetProviderRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getProvider(request, options, callback); + } + /** + * Gets details of a single Connector. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for Connector resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.connectors.v1.Connector|Connector}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.get_connector.js + * region_tag:connectors_v1_generated_Connectors_GetConnector_async + */ + getConnector( + request?: protos.google.cloud.connectors.v1.IGetConnectorRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnector, + protos.google.cloud.connectors.v1.IGetConnectorRequest | undefined, + {} | undefined, + ] + >; + getConnector( + request: protos.google.cloud.connectors.v1.IGetConnectorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IConnector, + protos.google.cloud.connectors.v1.IGetConnectorRequest | null | undefined, + {} | null | undefined + > + ): void; + getConnector( + request: protos.google.cloud.connectors.v1.IGetConnectorRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IConnector, + protos.google.cloud.connectors.v1.IGetConnectorRequest | null | undefined, + {} | null | undefined + > + ): void; + getConnector( + request?: protos.google.cloud.connectors.v1.IGetConnectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IConnector, + | protos.google.cloud.connectors.v1.IGetConnectorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IConnector, + protos.google.cloud.connectors.v1.IGetConnectorRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnector, + protos.google.cloud.connectors.v1.IGetConnectorRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getConnector(request, options, callback); + } + /** + * Gets details of a single connector version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /providers/* /connectors/* /versions/*` + * Only global location is supported for ConnectorVersion resource. + * @param {google.cloud.connectors.v1.ConnectorVersionView} request.view + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `CUSTOMER` view. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.connectors.v1.ConnectorVersion|ConnectorVersion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.get_connector_version.js + * region_tag:connectors_v1_generated_Connectors_GetConnectorVersion_async + */ + getConnectorVersion( + request?: protos.google.cloud.connectors.v1.IGetConnectorVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectorVersion, + protos.google.cloud.connectors.v1.IGetConnectorVersionRequest | undefined, + {} | undefined, + ] + >; + getConnectorVersion( + request: protos.google.cloud.connectors.v1.IGetConnectorVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IConnectorVersion, + | protos.google.cloud.connectors.v1.IGetConnectorVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnectorVersion( + request: protos.google.cloud.connectors.v1.IGetConnectorVersionRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IConnectorVersion, + | protos.google.cloud.connectors.v1.IGetConnectorVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnectorVersion( + request?: protos.google.cloud.connectors.v1.IGetConnectorVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IConnectorVersion, + | protos.google.cloud.connectors.v1.IGetConnectorVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IConnectorVersion, + | protos.google.cloud.connectors.v1.IGetConnectorVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectorVersion, + protos.google.cloud.connectors.v1.IGetConnectorVersionRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getConnectorVersion(request, options, callback); + } + /** + * Gets schema metadata of a connection. + * SchemaMetadata is a singleton resource for each connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Connection name + * Format: + * projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.connectors.v1.ConnectionSchemaMetadata|ConnectionSchemaMetadata}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.get_connection_schema_metadata.js + * region_tag:connectors_v1_generated_Connectors_GetConnectionSchemaMetadata_async + */ + getConnectionSchemaMetadata( + request?: protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + ( + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | undefined + ), + {} | undefined, + ] + >; + getConnectionSchemaMetadata( + request: protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnectionSchemaMetadata( + request: protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnectionSchemaMetadata( + request?: protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + ( + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getConnectionSchemaMetadata( + request, + options, + callback + ); + } + /** + * Gets the runtimeConfig of a location. + * RuntimeConfig is a singleton resource for each location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /runtimeConfig` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.connectors.v1.RuntimeConfig|RuntimeConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.get_runtime_config.js + * region_tag:connectors_v1_generated_Connectors_GetRuntimeConfig_async + */ + getRuntimeConfig( + request?: protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeConfig, + protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest | undefined, + {} | undefined, + ] + >; + getRuntimeConfig( + request: protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IRuntimeConfig, + | protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRuntimeConfig( + request: protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IRuntimeConfig, + | protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRuntimeConfig( + request?: protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IRuntimeConfig, + | protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IRuntimeConfig, + | protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeConfig, + protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getRuntimeConfig(request, options, callback); + } + /** + * GetGlobalSettings gets settings of a project. + * GlobalSettings is a singleton resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Settings. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.connectors.v1.Settings|Settings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.get_global_settings.js + * region_tag:connectors_v1_generated_Connectors_GetGlobalSettings_async + */ + getGlobalSettings( + request?: protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.ISettings, + protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest | undefined, + {} | undefined, + ] + >; + getGlobalSettings( + request: protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.ISettings, + | protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGlobalSettings( + request: protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest, + callback: Callback< + protos.google.cloud.connectors.v1.ISettings, + | protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGlobalSettings( + request?: protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.ISettings, + | protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.ISettings, + | protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.ISettings, + protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getGlobalSettings(request, options, callback); + } + + /** + * Creates a new Connection in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + * @param {string} request.connectionId + * Required. Identifier to assign to the Connection. Must be unique within + * scope of the parent resource. + * @param {google.cloud.connectors.v1.Connection} request.connection + * Required. Connection resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.create_connection.js + * region_tag:connectors_v1_generated_Connectors_CreateConnection_async + */ + createConnection( + request?: protos.google.cloud.connectors.v1.ICreateConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createConnection( + request: protos.google.cloud.connectors.v1.ICreateConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createConnection( + request: protos.google.cloud.connectors.v1.ICreateConnectionRequest, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createConnection( + request?: protos.google.cloud.connectors.v1.ICreateConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createConnection(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createConnection()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.create_connection.js + * region_tag:connectors_v1_generated_Connectors_CreateConnection_async + */ + async checkCreateConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.connectors.v1.Connection, + protos.google.cloud.connectors.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.connectors.v1.Connection, + protos.google.cloud.connectors.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.connectors.v1.Connection} request.connection + * Required. Connection resource. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. You can modify only the fields listed below. + * + * To lock/unlock a connection: + * * `lock_config` + * + * To suspend/resume a connection: + * * `suspended` + * + * To update the connection details: + * * `description` + * * `labels` + * * `connector_version` + * * `config_variables` + * * `auth_config` + * * `destination_configs` + * * `node_config` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.update_connection.js + * region_tag:connectors_v1_generated_Connectors_UpdateConnection_async + */ + updateConnection( + request?: protos.google.cloud.connectors.v1.IUpdateConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateConnection( + request: protos.google.cloud.connectors.v1.IUpdateConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateConnection( + request: protos.google.cloud.connectors.v1.IUpdateConnectionRequest, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateConnection( + request?: protos.google.cloud.connectors.v1.IUpdateConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'connection.name': request.connection!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateConnection(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateConnection()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.update_connection.js + * region_tag:connectors_v1_generated_Connectors_UpdateConnection_async + */ + async checkUpdateConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.connectors.v1.Connection, + protos.google.cloud.connectors.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.connectors.v1.Connection, + protos.google.cloud.connectors.v1.OperationMetadata + >; + } + /** + * Deletes a single Connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /connections/*` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.delete_connection.js + * region_tag:connectors_v1_generated_Connectors_DeleteConnection_async + */ + deleteConnection( + request?: protos.google.cloud.connectors.v1.IDeleteConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteConnection( + request: protos.google.cloud.connectors.v1.IDeleteConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteConnection( + request: protos.google.cloud.connectors.v1.IDeleteConnectionRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteConnection( + request?: protos.google.cloud.connectors.v1.IDeleteConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteConnection(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteConnection()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.delete_connection.js + * region_tag:connectors_v1_generated_Connectors_DeleteConnection_async + */ + async checkDeleteConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.connectors.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.connectors.v1.OperationMetadata + >; + } + /** + * Refresh runtime schema of a connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name. + * Format: + * projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.refresh_connection_schema_metadata.js + * region_tag:connectors_v1_generated_Connectors_RefreshConnectionSchemaMetadata_async + */ + refreshConnectionSchemaMetadata( + request?: protos.google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + refreshConnectionSchemaMetadata( + request: protos.google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + refreshConnectionSchemaMetadata( + request: protos.google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + refreshConnectionSchemaMetadata( + request?: protos.google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.refreshConnectionSchemaMetadata( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `refreshConnectionSchemaMetadata()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.refresh_connection_schema_metadata.js + * region_tag:connectors_v1_generated_Connectors_RefreshConnectionSchemaMetadata_async + */ + async checkRefreshConnectionSchemaMetadataProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.connectors.v1.ConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.refreshConnectionSchemaMetadata, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.connectors.v1.ConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.OperationMetadata + >; + } + /** + * Lists Connections in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Filter. + * @param {string} request.orderBy + * Order by parameters. + * @param {google.cloud.connectors.v1.ConnectionView} request.view + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.connectors.v1.Connection|Connection}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listConnectionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listConnections( + request?: protos.google.cloud.connectors.v1.IListConnectionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnection[], + protos.google.cloud.connectors.v1.IListConnectionsRequest | null, + protos.google.cloud.connectors.v1.IListConnectionsResponse, + ] + >; + listConnections( + request: protos.google.cloud.connectors.v1.IListConnectionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectionsRequest, + | protos.google.cloud.connectors.v1.IListConnectionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnection + > + ): void; + listConnections( + request: protos.google.cloud.connectors.v1.IListConnectionsRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectionsRequest, + | protos.google.cloud.connectors.v1.IListConnectionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnection + > + ): void; + listConnections( + request?: protos.google.cloud.connectors.v1.IListConnectionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectionsRequest, + | protos.google.cloud.connectors.v1.IListConnectionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnection + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectionsRequest, + | protos.google.cloud.connectors.v1.IListConnectionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnection + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnection[], + protos.google.cloud.connectors.v1.IListConnectionsRequest | null, + protos.google.cloud.connectors.v1.IListConnectionsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listConnections(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Filter. + * @param {string} request.orderBy + * Order by parameters. + * @param {google.cloud.connectors.v1.ConnectionView} request.view + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.connectors.v1.Connection|Connection} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listConnectionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listConnectionsStream( + request?: protos.google.cloud.connectors.v1.IListConnectionsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listConnections']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnections.createStream( + this.innerApiCalls.listConnections as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConnections`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Filter. + * @param {string} request.orderBy + * Order by parameters. + * @param {google.cloud.connectors.v1.ConnectionView} request.view + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.connectors.v1.Connection|Connection}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.list_connections.js + * region_tag:connectors_v1_generated_Connectors_ListConnections_async + */ + listConnectionsAsync( + request?: protos.google.cloud.connectors.v1.IListConnectionsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listConnections']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnections.asyncIterate( + this.innerApiCalls['listConnections'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Providers in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the API, of the form: + * `projects/* /locations/*` + * Only global location is supported for Provider resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.connectors.v1.Provider|Provider}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listProvidersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listProviders( + request?: protos.google.cloud.connectors.v1.IListProvidersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IProvider[], + protos.google.cloud.connectors.v1.IListProvidersRequest | null, + protos.google.cloud.connectors.v1.IListProvidersResponse, + ] + >; + listProviders( + request: protos.google.cloud.connectors.v1.IListProvidersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListProvidersRequest, + | protos.google.cloud.connectors.v1.IListProvidersResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IProvider + > + ): void; + listProviders( + request: protos.google.cloud.connectors.v1.IListProvidersRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListProvidersRequest, + | protos.google.cloud.connectors.v1.IListProvidersResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IProvider + > + ): void; + listProviders( + request?: protos.google.cloud.connectors.v1.IListProvidersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListProvidersRequest, + | protos.google.cloud.connectors.v1.IListProvidersResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IProvider + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListProvidersRequest, + | protos.google.cloud.connectors.v1.IListProvidersResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IProvider + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IProvider[], + protos.google.cloud.connectors.v1.IListProvidersRequest | null, + protos.google.cloud.connectors.v1.IListProvidersResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listProviders(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the API, of the form: + * `projects/* /locations/*` + * Only global location is supported for Provider resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.connectors.v1.Provider|Provider} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listProvidersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listProvidersStream( + request?: protos.google.cloud.connectors.v1.IListProvidersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listProviders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listProviders.createStream( + this.innerApiCalls.listProviders as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listProviders`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the API, of the form: + * `projects/* /locations/*` + * Only global location is supported for Provider resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.connectors.v1.Provider|Provider}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.list_providers.js + * region_tag:connectors_v1_generated_Connectors_ListProviders_async + */ + listProvidersAsync( + request?: protos.google.cloud.connectors.v1.IListProvidersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listProviders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listProviders.asyncIterate( + this.innerApiCalls['listProviders'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Connectors in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Connector resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.connectors.v1.Connector|Connector}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listConnectorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listConnectors( + request?: protos.google.cloud.connectors.v1.IListConnectorsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnector[], + protos.google.cloud.connectors.v1.IListConnectorsRequest | null, + protos.google.cloud.connectors.v1.IListConnectorsResponse, + ] + >; + listConnectors( + request: protos.google.cloud.connectors.v1.IListConnectorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorsRequest, + | protos.google.cloud.connectors.v1.IListConnectorsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnector + > + ): void; + listConnectors( + request: protos.google.cloud.connectors.v1.IListConnectorsRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorsRequest, + | protos.google.cloud.connectors.v1.IListConnectorsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnector + > + ): void; + listConnectors( + request?: protos.google.cloud.connectors.v1.IListConnectorsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorsRequest, + | protos.google.cloud.connectors.v1.IListConnectorsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnector + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorsRequest, + | protos.google.cloud.connectors.v1.IListConnectorsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnector + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnector[], + protos.google.cloud.connectors.v1.IListConnectorsRequest | null, + protos.google.cloud.connectors.v1.IListConnectorsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listConnectors(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Connector resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.connectors.v1.Connector|Connector} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listConnectorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listConnectorsStream( + request?: protos.google.cloud.connectors.v1.IListConnectorsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listConnectors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectors.createStream( + this.innerApiCalls.listConnectors as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConnectors`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Connector resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.connectors.v1.Connector|Connector}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.list_connectors.js + * region_tag:connectors_v1_generated_Connectors_ListConnectors_async + */ + listConnectorsAsync( + request?: protos.google.cloud.connectors.v1.IListConnectorsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listConnectors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectors.asyncIterate( + this.innerApiCalls['listConnectors'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Connector Versions in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for ConnectorVersion resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {google.cloud.connectors.v1.ConnectorVersionView} request.view + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `BASIC` view. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.connectors.v1.ConnectorVersion|ConnectorVersion}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listConnectorVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listConnectorVersions( + request?: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectorVersion[], + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest | null, + protos.google.cloud.connectors.v1.IListConnectorVersionsResponse, + ] + >; + listConnectorVersions( + request: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + | protos.google.cloud.connectors.v1.IListConnectorVersionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnectorVersion + > + ): void; + listConnectorVersions( + request: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + | protos.google.cloud.connectors.v1.IListConnectorVersionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnectorVersion + > + ): void; + listConnectorVersions( + request?: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + | protos.google.cloud.connectors.v1.IListConnectorVersionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnectorVersion + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + | protos.google.cloud.connectors.v1.IListConnectorVersionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnectorVersion + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectorVersion[], + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest | null, + protos.google.cloud.connectors.v1.IListConnectorVersionsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listConnectorVersions(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for ConnectorVersion resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {google.cloud.connectors.v1.ConnectorVersionView} request.view + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `BASIC` view. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.connectors.v1.ConnectorVersion|ConnectorVersion} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listConnectorVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listConnectorVersionsStream( + request?: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listConnectorVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectorVersions.createStream( + this.innerApiCalls.listConnectorVersions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConnectorVersions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for ConnectorVersion resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {google.cloud.connectors.v1.ConnectorVersionView} request.view + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `BASIC` view. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.connectors.v1.ConnectorVersion|ConnectorVersion}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.list_connector_versions.js + * region_tag:connectors_v1_generated_Connectors_ListConnectorVersions_async + */ + listConnectorVersionsAsync( + request?: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listConnectorVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectorVersions.asyncIterate( + this.innerApiCalls['listConnectorVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List schema of a runtime entities filtered by entity name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of RuntimeEntitySchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * entity="{entityId}" + * Only entity field is supported with literal equality operator. + * Accepted filter example: entity="Order" + * Wildcards are not supported in the filter currently. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.connectors.v1.RuntimeEntitySchema|RuntimeEntitySchema}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listRuntimeEntitySchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRuntimeEntitySchemas( + request?: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeEntitySchema[], + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest | null, + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse, + ] + >; + listRuntimeEntitySchemas( + request: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeEntitySchema + > + ): void; + listRuntimeEntitySchemas( + request: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeEntitySchema + > + ): void; + listRuntimeEntitySchemas( + request?: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeEntitySchema + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeEntitySchema + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeEntitySchema[], + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest | null, + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listRuntimeEntitySchemas( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of RuntimeEntitySchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * entity="{entityId}" + * Only entity field is supported with literal equality operator. + * Accepted filter example: entity="Order" + * Wildcards are not supported in the filter currently. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.connectors.v1.RuntimeEntitySchema|RuntimeEntitySchema} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listRuntimeEntitySchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRuntimeEntitySchemasStream( + request?: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRuntimeEntitySchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeEntitySchemas.createStream( + this.innerApiCalls.listRuntimeEntitySchemas as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRuntimeEntitySchemas`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of RuntimeEntitySchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * entity="{entityId}" + * Only entity field is supported with literal equality operator. + * Accepted filter example: entity="Order" + * Wildcards are not supported in the filter currently. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.connectors.v1.RuntimeEntitySchema|RuntimeEntitySchema}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.list_runtime_entity_schemas.js + * region_tag:connectors_v1_generated_Connectors_ListRuntimeEntitySchemas_async + */ + listRuntimeEntitySchemasAsync( + request?: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRuntimeEntitySchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeEntitySchemas.asyncIterate( + this.innerApiCalls['listRuntimeEntitySchemas'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List schema of a runtime actions filtered by action name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of RuntimeActionSchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * action="{actionId}" + * Only action field is supported with literal equality operator. + * Accepted filter example: action="CancelOrder" + * Wildcards are not supported in the filter currently. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.connectors.v1.RuntimeActionSchema|RuntimeActionSchema}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listRuntimeActionSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRuntimeActionSchemas( + request?: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeActionSchema[], + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest | null, + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse, + ] + >; + listRuntimeActionSchemas( + request: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeActionSchema + > + ): void; + listRuntimeActionSchemas( + request: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeActionSchema + > + ): void; + listRuntimeActionSchemas( + request?: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeActionSchema + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeActionSchema + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeActionSchema[], + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest | null, + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listRuntimeActionSchemas( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of RuntimeActionSchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * action="{actionId}" + * Only action field is supported with literal equality operator. + * Accepted filter example: action="CancelOrder" + * Wildcards are not supported in the filter currently. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.connectors.v1.RuntimeActionSchema|RuntimeActionSchema} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listRuntimeActionSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRuntimeActionSchemasStream( + request?: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRuntimeActionSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeActionSchemas.createStream( + this.innerApiCalls.listRuntimeActionSchemas as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRuntimeActionSchemas`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of RuntimeActionSchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * action="{actionId}" + * Only action field is supported with literal equality operator. + * Accepted filter example: action="CancelOrder" + * Wildcards are not supported in the filter currently. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.connectors.v1.RuntimeActionSchema|RuntimeActionSchema}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/connectors.list_runtime_action_schemas.js + * region_tag:connectors_v1_generated_Connectors_ListRuntimeActionSchemas_async + */ + listRuntimeActionSchemasAsync( + request?: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRuntimeActionSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeActionSchemas.asyncIterate( + this.innerApiCalls['listRuntimeActionSchemas'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified connection resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} connection + * @returns {string} Resource name string. + */ + connectionPath(project: string, location: string, connection: string) { + return this.pathTemplates.connectionPathTemplate.render({ + project: project, + location: location, + connection: connection, + }); + } + + /** + * Parse the project from Connection resource. + * + * @param {string} connectionName + * A fully-qualified path representing Connection resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionName(connectionName: string) { + return this.pathTemplates.connectionPathTemplate.match(connectionName) + .project; + } + + /** + * Parse the location from Connection resource. + * + * @param {string} connectionName + * A fully-qualified path representing Connection resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionName(connectionName: string) { + return this.pathTemplates.connectionPathTemplate.match(connectionName) + .location; + } + + /** + * Parse the connection from Connection resource. + * + * @param {string} connectionName + * A fully-qualified path representing Connection resource. + * @returns {string} A string representing the connection. + */ + matchConnectionFromConnectionName(connectionName: string) { + return this.pathTemplates.connectionPathTemplate.match(connectionName) + .connection; + } + + /** + * Return a fully-qualified connectionSchemaMetadata resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} connection + * @returns {string} Resource name string. + */ + connectionSchemaMetadataPath( + project: string, + location: string, + connection: string + ) { + return this.pathTemplates.connectionSchemaMetadataPathTemplate.render({ + project: project, + location: location, + connection: connection, + }); + } + + /** + * Parse the project from ConnectionSchemaMetadata resource. + * + * @param {string} connectionSchemaMetadataName + * A fully-qualified path representing ConnectionSchemaMetadata resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionSchemaMetadataName( + connectionSchemaMetadataName: string + ) { + return this.pathTemplates.connectionSchemaMetadataPathTemplate.match( + connectionSchemaMetadataName + ).project; + } + + /** + * Parse the location from ConnectionSchemaMetadata resource. + * + * @param {string} connectionSchemaMetadataName + * A fully-qualified path representing ConnectionSchemaMetadata resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionSchemaMetadataName( + connectionSchemaMetadataName: string + ) { + return this.pathTemplates.connectionSchemaMetadataPathTemplate.match( + connectionSchemaMetadataName + ).location; + } + + /** + * Parse the connection from ConnectionSchemaMetadata resource. + * + * @param {string} connectionSchemaMetadataName + * A fully-qualified path representing ConnectionSchemaMetadata resource. + * @returns {string} A string representing the connection. + */ + matchConnectionFromConnectionSchemaMetadataName( + connectionSchemaMetadataName: string + ) { + return this.pathTemplates.connectionSchemaMetadataPathTemplate.match( + connectionSchemaMetadataName + ).connection; + } + + /** + * Return a fully-qualified connector resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} provider + * @param {string} connector + * @returns {string} Resource name string. + */ + connectorPath( + project: string, + location: string, + provider: string, + connector: string + ) { + return this.pathTemplates.connectorPathTemplate.render({ + project: project, + location: location, + provider: provider, + connector: connector, + }); + } + + /** + * Parse the project from Connector resource. + * + * @param {string} connectorName + * A fully-qualified path representing Connector resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectorName(connectorName: string) { + return this.pathTemplates.connectorPathTemplate.match(connectorName) + .project; + } + + /** + * Parse the location from Connector resource. + * + * @param {string} connectorName + * A fully-qualified path representing Connector resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectorName(connectorName: string) { + return this.pathTemplates.connectorPathTemplate.match(connectorName) + .location; + } + + /** + * Parse the provider from Connector resource. + * + * @param {string} connectorName + * A fully-qualified path representing Connector resource. + * @returns {string} A string representing the provider. + */ + matchProviderFromConnectorName(connectorName: string) { + return this.pathTemplates.connectorPathTemplate.match(connectorName) + .provider; + } + + /** + * Parse the connector from Connector resource. + * + * @param {string} connectorName + * A fully-qualified path representing Connector resource. + * @returns {string} A string representing the connector. + */ + matchConnectorFromConnectorName(connectorName: string) { + return this.pathTemplates.connectorPathTemplate.match(connectorName) + .connector; + } + + /** + * Return a fully-qualified connectorVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} provider + * @param {string} connector + * @param {string} version + * @returns {string} Resource name string. + */ + connectorVersionPath( + project: string, + location: string, + provider: string, + connector: string, + version: string + ) { + return this.pathTemplates.connectorVersionPathTemplate.render({ + project: project, + location: location, + provider: provider, + connector: connector, + version: version, + }); + } + + /** + * Parse the project from ConnectorVersion resource. + * + * @param {string} connectorVersionName + * A fully-qualified path representing ConnectorVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectorVersionName(connectorVersionName: string) { + return this.pathTemplates.connectorVersionPathTemplate.match( + connectorVersionName + ).project; + } + + /** + * Parse the location from ConnectorVersion resource. + * + * @param {string} connectorVersionName + * A fully-qualified path representing ConnectorVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectorVersionName(connectorVersionName: string) { + return this.pathTemplates.connectorVersionPathTemplate.match( + connectorVersionName + ).location; + } + + /** + * Parse the provider from ConnectorVersion resource. + * + * @param {string} connectorVersionName + * A fully-qualified path representing ConnectorVersion resource. + * @returns {string} A string representing the provider. + */ + matchProviderFromConnectorVersionName(connectorVersionName: string) { + return this.pathTemplates.connectorVersionPathTemplate.match( + connectorVersionName + ).provider; + } + + /** + * Parse the connector from ConnectorVersion resource. + * + * @param {string} connectorVersionName + * A fully-qualified path representing ConnectorVersion resource. + * @returns {string} A string representing the connector. + */ + matchConnectorFromConnectorVersionName(connectorVersionName: string) { + return this.pathTemplates.connectorVersionPathTemplate.match( + connectorVersionName + ).connector; + } + + /** + * Parse the version from ConnectorVersion resource. + * + * @param {string} connectorVersionName + * A fully-qualified path representing ConnectorVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromConnectorVersionName(connectorVersionName: string) { + return this.pathTemplates.connectorVersionPathTemplate.match( + connectorVersionName + ).version; + } + + /** + * Return a fully-qualified provider resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} provider + * @returns {string} Resource name string. + */ + providerPath(project: string, location: string, provider: string) { + return this.pathTemplates.providerPathTemplate.render({ + project: project, + location: location, + provider: provider, + }); + } + + /** + * Parse the project from Provider resource. + * + * @param {string} providerName + * A fully-qualified path representing Provider resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProviderName(providerName: string) { + return this.pathTemplates.providerPathTemplate.match(providerName).project; + } + + /** + * Parse the location from Provider resource. + * + * @param {string} providerName + * A fully-qualified path representing Provider resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProviderName(providerName: string) { + return this.pathTemplates.providerPathTemplate.match(providerName).location; + } + + /** + * Parse the provider from Provider resource. + * + * @param {string} providerName + * A fully-qualified path representing Provider resource. + * @returns {string} A string representing the provider. + */ + matchProviderFromProviderName(providerName: string) { + return this.pathTemplates.providerPathTemplate.match(providerName).provider; + } + + /** + * Return a fully-qualified runtimeConfig resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + runtimeConfigPath(project: string, location: string) { + return this.pathTemplates.runtimeConfigPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from RuntimeConfig resource. + * + * @param {string} runtimeConfigName + * A fully-qualified path representing RuntimeConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeConfigName(runtimeConfigName: string) { + return this.pathTemplates.runtimeConfigPathTemplate.match(runtimeConfigName) + .project; + } + + /** + * Parse the location from RuntimeConfig resource. + * + * @param {string} runtimeConfigName + * A fully-qualified path representing RuntimeConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeConfigName(runtimeConfigName: string) { + return this.pathTemplates.runtimeConfigPathTemplate.match(runtimeConfigName) + .location; + } + + /** + * Return a fully-qualified settings resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + settingsPath(project: string) { + return this.pathTemplates.settingsPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Settings resource. + * + * @param {string} settingsName + * A fully-qualified path representing Settings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSettingsName(settingsName: string) { + return this.pathTemplates.settingsPathTemplate.match(settingsName).project; + } + + /** + * 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 { + if (this.connectorsStub && !this._terminated) { + return this.connectorsStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-connectors/src/v1/connectors_client_config.json b/packages/google-cloud-connectors/src/v1/connectors_client_config.json new file mode 100644 index 00000000000..5ad6188283a --- /dev/null +++ b/packages/google-cloud-connectors/src/v1/connectors_client_config.json @@ -0,0 +1,121 @@ +{ + "interfaces": { + "google.cloud.connectors.v1.Connectors": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListConnections": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetConnection": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListProviders": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetProvider": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListConnectors": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetConnector": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListConnectorVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetConnectorVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetConnectionSchemaMetadata": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "RefreshConnectionSchemaMetadata": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRuntimeEntitySchemas": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListRuntimeActionSchemas": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetRuntimeConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetGlobalSettings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-connectors/src/v1/connectors_proto_list.json b/packages/google-cloud-connectors/src/v1/connectors_proto_list.json new file mode 100644 index 00000000000..446890c3971 --- /dev/null +++ b/packages/google-cloud-connectors/src/v1/connectors_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/connectors/v1/authconfig.proto", + "../../protos/google/cloud/connectors/v1/common.proto", + "../../protos/google/cloud/connectors/v1/connection.proto", + "../../protos/google/cloud/connectors/v1/connector.proto", + "../../protos/google/cloud/connectors/v1/connector_version.proto", + "../../protos/google/cloud/connectors/v1/connectors_service.proto", + "../../protos/google/cloud/connectors/v1/destination_config.proto", + "../../protos/google/cloud/connectors/v1/provider.proto", + "../../protos/google/cloud/connectors/v1/runtime.proto", + "../../protos/google/cloud/connectors/v1/settings.proto", + "../../protos/google/cloud/connectors/v1/ssl_config.proto" +] diff --git a/packages/google-cloud-connectors/src/v1/gapic_metadata.json b/packages/google-cloud-connectors/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..6a631566481 --- /dev/null +++ b/packages/google-cloud-connectors/src/v1/gapic_metadata.json @@ -0,0 +1,217 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.connectors.v1", + "libraryPackage": "@google-cloud/connectors", + "services": { + "Connectors": { + "clients": { + "grpc": { + "libraryClient": "ConnectorsClient", + "rpcs": { + "GetConnection": { + "methods": [ + "getConnection" + ] + }, + "GetProvider": { + "methods": [ + "getProvider" + ] + }, + "GetConnector": { + "methods": [ + "getConnector" + ] + }, + "GetConnectorVersion": { + "methods": [ + "getConnectorVersion" + ] + }, + "GetConnectionSchemaMetadata": { + "methods": [ + "getConnectionSchemaMetadata" + ] + }, + "GetRuntimeConfig": { + "methods": [ + "getRuntimeConfig" + ] + }, + "GetGlobalSettings": { + "methods": [ + "getGlobalSettings" + ] + }, + "CreateConnection": { + "methods": [ + "createConnection" + ] + }, + "UpdateConnection": { + "methods": [ + "updateConnection" + ] + }, + "DeleteConnection": { + "methods": [ + "deleteConnection" + ] + }, + "RefreshConnectionSchemaMetadata": { + "methods": [ + "refreshConnectionSchemaMetadata" + ] + }, + "ListConnections": { + "methods": [ + "listConnections", + "listConnectionsStream", + "listConnectionsAsync" + ] + }, + "ListProviders": { + "methods": [ + "listProviders", + "listProvidersStream", + "listProvidersAsync" + ] + }, + "ListConnectors": { + "methods": [ + "listConnectors", + "listConnectorsStream", + "listConnectorsAsync" + ] + }, + "ListConnectorVersions": { + "methods": [ + "listConnectorVersions", + "listConnectorVersionsStream", + "listConnectorVersionsAsync" + ] + }, + "ListRuntimeEntitySchemas": { + "methods": [ + "listRuntimeEntitySchemas", + "listRuntimeEntitySchemasStream", + "listRuntimeEntitySchemasAsync" + ] + }, + "ListRuntimeActionSchemas": { + "methods": [ + "listRuntimeActionSchemas", + "listRuntimeActionSchemasStream", + "listRuntimeActionSchemasAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ConnectorsClient", + "rpcs": { + "GetConnection": { + "methods": [ + "getConnection" + ] + }, + "GetProvider": { + "methods": [ + "getProvider" + ] + }, + "GetConnector": { + "methods": [ + "getConnector" + ] + }, + "GetConnectorVersion": { + "methods": [ + "getConnectorVersion" + ] + }, + "GetConnectionSchemaMetadata": { + "methods": [ + "getConnectionSchemaMetadata" + ] + }, + "GetRuntimeConfig": { + "methods": [ + "getRuntimeConfig" + ] + }, + "GetGlobalSettings": { + "methods": [ + "getGlobalSettings" + ] + }, + "CreateConnection": { + "methods": [ + "createConnection" + ] + }, + "UpdateConnection": { + "methods": [ + "updateConnection" + ] + }, + "DeleteConnection": { + "methods": [ + "deleteConnection" + ] + }, + "RefreshConnectionSchemaMetadata": { + "methods": [ + "refreshConnectionSchemaMetadata" + ] + }, + "ListConnections": { + "methods": [ + "listConnections", + "listConnectionsStream", + "listConnectionsAsync" + ] + }, + "ListProviders": { + "methods": [ + "listProviders", + "listProvidersStream", + "listProvidersAsync" + ] + }, + "ListConnectors": { + "methods": [ + "listConnectors", + "listConnectorsStream", + "listConnectorsAsync" + ] + }, + "ListConnectorVersions": { + "methods": [ + "listConnectorVersions", + "listConnectorVersionsStream", + "listConnectorVersionsAsync" + ] + }, + "ListRuntimeEntitySchemas": { + "methods": [ + "listRuntimeEntitySchemas", + "listRuntimeEntitySchemasStream", + "listRuntimeEntitySchemasAsync" + ] + }, + "ListRuntimeActionSchemas": { + "methods": [ + "listRuntimeActionSchemas", + "listRuntimeActionSchemasStream", + "listRuntimeActionSchemasAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-connectors/src/v1/index.ts b/packages/google-cloud-connectors/src/v1/index.ts new file mode 100644 index 00000000000..eac9244d2ce --- /dev/null +++ b/packages/google-cloud-connectors/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 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 {ConnectorsClient} from './connectors_client'; diff --git a/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.js b/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..62ab7f01e19 --- /dev/null +++ b/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2023 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 connectors = require('@google-cloud/connectors'); + +function main() { + const connectorsClient = new connectors.ConnectorsClient(); +} + +main(); diff --git a/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..02748d561c2 --- /dev/null +++ b/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 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 {ConnectorsClient} from '@google-cloud/connectors'; + +// check that the client class type name can be used +function doStuffWithConnectorsClient(client: ConnectorsClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const connectorsClient = new ConnectorsClient(); + doStuffWithConnectorsClient(connectorsClient); +} + +main(); diff --git a/packages/google-cloud-connectors/system-test/install.ts b/packages/google-cloud-connectors/system-test/install.ts new file mode 100644 index 00000000000..f61fe236476 --- /dev/null +++ b/packages/google-cloud-connectors/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-connectors/test/gapic_connectors_v1.ts b/packages/google-cloud-connectors/test/gapic_connectors_v1.ts new file mode 100644 index 00000000000..d97ad9a0440 --- /dev/null +++ b/packages/google-cloud-connectors/test/gapic_connectors_v1.ts @@ -0,0 +1,5271 @@ +// Copyright 2023 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 connectorsModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} 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 + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.ConnectorsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = connectorsModule.v1.ConnectorsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = connectorsModule.v1.ConnectorsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = connectorsModule.v1.ConnectorsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new connectorsModule.v1.ConnectorsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new connectorsModule.v1.ConnectorsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.connectorsStub, undefined); + await client.initialize(); + assert(client.connectorsStub); + }); + + it('has close method for the initialized client', done => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.connectorsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.connectorsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new connectorsModule.v1.ConnectorsClient({ + 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 connectorsModule.v1.ConnectorsClient({ + 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('getConnection', () => { + it('invokes getConnection without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ); + client.innerApiCalls.getConnection = stubSimpleCall(expectedResponse); + const [response] = await client.getConnection(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnection without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ); + client.innerApiCalls.getConnection = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnection( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnection | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnection with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnection = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnection with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConnection(request), expectedError); + }); + }); + + describe('getProvider', () => { + it('invokes getProvider without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetProviderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetProviderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Provider() + ); + client.innerApiCalls.getProvider = stubSimpleCall(expectedResponse); + const [response] = await client.getProvider(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProvider without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetProviderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetProviderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Provider() + ); + client.innerApiCalls.getProvider = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProvider( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IProvider | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProvider with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetProviderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetProviderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProvider = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getProvider(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProvider with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetProviderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetProviderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getProvider(request), expectedError); + }); + }); + + describe('getConnector', () => { + it('invokes getConnector without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ); + client.innerApiCalls.getConnector = stubSimpleCall(expectedResponse); + const [response] = await client.getConnector(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnector without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ); + client.innerApiCalls.getConnector = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnector( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnector | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnector with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnector = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getConnector(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnector with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConnector(request), expectedError); + }); + }); + + describe('getConnectorVersion', () => { + it('invokes getConnectorVersion without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ); + client.innerApiCalls.getConnectorVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.getConnectorVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectorVersion without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ); + client.innerApiCalls.getConnectorVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnectorVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnectorVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectorVersion with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnectorVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getConnectorVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectorVersion with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConnectorVersion(request), expectedError); + }); + }); + + describe('getConnectionSchemaMetadata', () => { + it('invokes getConnectionSchemaMetadata without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectionSchemaMetadata() + ); + client.innerApiCalls.getConnectionSchemaMetadata = + stubSimpleCall(expectedResponse); + const [response] = await client.getConnectionSchemaMetadata(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionSchemaMetadata without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectionSchemaMetadata() + ); + client.innerApiCalls.getConnectionSchemaMetadata = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnectionSchemaMetadata( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnectionSchemaMetadata | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionSchemaMetadata with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnectionSchemaMetadata = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getConnectionSchemaMetadata(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionSchemaMetadata with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getConnectionSchemaMetadata(request), + expectedError + ); + }); + }); + + describe('getRuntimeConfig', () => { + it('invokes getRuntimeConfig without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetRuntimeConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetRuntimeConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeConfig() + ); + client.innerApiCalls.getRuntimeConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getRuntimeConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeConfig without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetRuntimeConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetRuntimeConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeConfig() + ); + client.innerApiCalls.getRuntimeConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRuntimeConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IRuntimeConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeConfig with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetRuntimeConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetRuntimeConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRuntimeConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRuntimeConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeConfig with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetRuntimeConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetRuntimeConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRuntimeConfig(request), expectedError); + }); + }); + + describe('getGlobalSettings', () => { + it('invokes getGlobalSettings without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetGlobalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetGlobalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Settings() + ); + client.innerApiCalls.getGlobalSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getGlobalSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGlobalSettings without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetGlobalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetGlobalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Settings() + ); + client.innerApiCalls.getGlobalSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGlobalSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.ISettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGlobalSettings with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetGlobalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetGlobalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGlobalSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getGlobalSettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGlobalSettings with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetGlobalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetGlobalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGlobalSettings(request), expectedError); + }); + }); + + describe('createConnection', () => { + it('invokes createConnection without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.CreateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.CreateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnection without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.CreateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.CreateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnection with call error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.CreateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.CreateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnection with LRO error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.CreateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.CreateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateConnectionProgress without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateConnectionProgress with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateConnection', () => { + it('invokes updateConnection without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.UpdateConnectionRequest() + ); + request.connection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.UpdateConnectionRequest', + ['connection', 'name'] + ); + request.connection.name = defaultValue1; + const expectedHeaderRequestParams = `connection.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnection without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.UpdateConnectionRequest() + ); + request.connection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.UpdateConnectionRequest', + ['connection', 'name'] + ); + request.connection.name = defaultValue1; + const expectedHeaderRequestParams = `connection.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnection with call error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.UpdateConnectionRequest() + ); + request.connection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.UpdateConnectionRequest', + ['connection', 'name'] + ); + request.connection.name = defaultValue1; + const expectedHeaderRequestParams = `connection.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnection with LRO error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.UpdateConnectionRequest() + ); + request.connection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.UpdateConnectionRequest', + ['connection', 'name'] + ); + request.connection.name = defaultValue1; + const expectedHeaderRequestParams = `connection.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateConnectionProgress without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateConnectionProgress with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteConnection', () => { + it('invokes deleteConnection without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.DeleteConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.DeleteConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnection without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.DeleteConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.DeleteConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnection with call error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.DeleteConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.DeleteConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnection with LRO error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.DeleteConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.DeleteConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteConnectionProgress without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteConnectionProgress with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('refreshConnectionSchemaMetadata', () => { + it('invokes refreshConnectionSchemaMetadata without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.refreshConnectionSchemaMetadata = + stubLongRunningCall(expectedResponse); + const [operation] = await client.refreshConnectionSchemaMetadata(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes refreshConnectionSchemaMetadata without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.refreshConnectionSchemaMetadata = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.refreshConnectionSchemaMetadata( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes refreshConnectionSchemaMetadata with call error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.refreshConnectionSchemaMetadata = + stubLongRunningCall(undefined, expectedError); + await assert.rejects( + client.refreshConnectionSchemaMetadata(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes refreshConnectionSchemaMetadata with LRO error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.refreshConnectionSchemaMetadata = + stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.refreshConnectionSchemaMetadata(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRefreshConnectionSchemaMetadataProgress without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkRefreshConnectionSchemaMetadataProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRefreshConnectionSchemaMetadataProgress with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRefreshConnectionSchemaMetadataProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listConnections', () => { + it('invokes listConnections without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + ]; + client.innerApiCalls.listConnections = stubSimpleCall(expectedResponse); + const [response] = await client.listConnections(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnections without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + ]; + client.innerApiCalls.listConnections = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConnections( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnection[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnections with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConnections = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listConnections(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectionsStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + ]; + client.descriptors.page.listConnections.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listConnectionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Connection[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Connection) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listConnections.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConnections, request) + ); + assert( + (client.descriptors.page.listConnections.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConnectionsStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnections.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listConnectionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Connection[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Connection) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listConnections.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConnections, request) + ); + assert( + (client.descriptors.page.listConnections.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnections without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + ]; + client.descriptors.page.listConnections.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IConnection[] = []; + const iterable = client.listConnectionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnections.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listConnections.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnections with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnections.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConnectionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IConnection[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnections.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listConnections.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listProviders', () => { + it('invokes listProviders without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + ]; + client.innerApiCalls.listProviders = stubSimpleCall(expectedResponse); + const [response] = await client.listProviders(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProviders without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + ]; + client.innerApiCalls.listProviders = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProviders( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IProvider[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProviders with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listProviders = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listProviders(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProvidersStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + ]; + client.descriptors.page.listProviders.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listProvidersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Provider[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Provider) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listProviders.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listProviders, request) + ); + assert( + (client.descriptors.page.listProviders.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listProvidersStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listProviders.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listProvidersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Provider[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Provider) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listProviders.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listProviders, request) + ); + assert( + (client.descriptors.page.listProviders.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProviders without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + ]; + client.descriptors.page.listProviders.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IProvider[] = []; + const iterable = client.listProvidersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listProviders.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listProviders.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProviders with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listProviders.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProvidersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IProvider[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listProviders.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listProviders.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConnectors', () => { + it('invokes listConnectors without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + ]; + client.innerApiCalls.listConnectors = stubSimpleCall(expectedResponse); + const [response] = await client.listConnectors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectors without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + ]; + client.innerApiCalls.listConnectors = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConnectors( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnector[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectors with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConnectors = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listConnectors(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectorsStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + ]; + client.descriptors.page.listConnectors.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listConnectorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Connector[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Connector) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listConnectors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectors, request) + ); + assert( + (client.descriptors.page.listConnectors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConnectorsStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectors.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listConnectorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Connector[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Connector) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listConnectors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectors, request) + ); + assert( + (client.descriptors.page.listConnectors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectors without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + ]; + client.descriptors.page.listConnectors.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IConnector[] = []; + const iterable = client.listConnectorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectors.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listConnectors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectors with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectors.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConnectorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IConnector[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectors.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listConnectors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConnectorVersions', () => { + it('invokes listConnectorVersions without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + ]; + client.innerApiCalls.listConnectorVersions = + stubSimpleCall(expectedResponse); + const [response] = await client.listConnectorVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectorVersions without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + ]; + client.innerApiCalls.listConnectorVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConnectorVersions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.connectors.v1.IConnectorVersion[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectorVersions with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConnectorVersions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listConnectorVersions(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectorVersionsStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + ]; + client.descriptors.page.listConnectorVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listConnectorVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.ConnectorVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.ConnectorVersion) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listConnectorVersions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectorVersions, request) + ); + assert( + ( + client.descriptors.page.listConnectorVersions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConnectorVersionsStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectorVersions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listConnectorVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.ConnectorVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.ConnectorVersion) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listConnectorVersions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectorVersions, request) + ); + assert( + ( + client.descriptors.page.listConnectorVersions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectorVersions without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + ]; + client.descriptors.page.listConnectorVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IConnectorVersion[] = + []; + const iterable = client.listConnectorVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectorVersions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listConnectorVersions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectorVersions with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectorVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConnectorVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IConnectorVersion[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectorVersions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listConnectorVersions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listRuntimeEntitySchemas', () => { + it('invokes listRuntimeEntitySchemas without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + ]; + client.innerApiCalls.listRuntimeEntitySchemas = + stubSimpleCall(expectedResponse); + const [response] = await client.listRuntimeEntitySchemas(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeEntitySchemas without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + ]; + client.innerApiCalls.listRuntimeEntitySchemas = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRuntimeEntitySchemas( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.connectors.v1.IRuntimeEntitySchema[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeEntitySchemas with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRuntimeEntitySchemas = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listRuntimeEntitySchemas(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeEntitySchemasStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + ]; + client.descriptors.page.listRuntimeEntitySchemas.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRuntimeEntitySchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.RuntimeEntitySchema[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.RuntimeEntitySchema) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listRuntimeEntitySchemas + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRuntimeEntitySchemas, request) + ); + assert( + ( + client.descriptors.page.listRuntimeEntitySchemas + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRuntimeEntitySchemasStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeEntitySchemas.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRuntimeEntitySchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.RuntimeEntitySchema[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.RuntimeEntitySchema) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listRuntimeEntitySchemas + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRuntimeEntitySchemas, request) + ); + assert( + ( + client.descriptors.page.listRuntimeEntitySchemas + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeEntitySchemas without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + ]; + client.descriptors.page.listRuntimeEntitySchemas.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IRuntimeEntitySchema[] = + []; + const iterable = client.listRuntimeEntitySchemasAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRuntimeEntitySchemas + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listRuntimeEntitySchemas + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeEntitySchemas with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeEntitySchemas.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRuntimeEntitySchemasAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IRuntimeEntitySchema[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRuntimeEntitySchemas + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listRuntimeEntitySchemas + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listRuntimeActionSchemas', () => { + it('invokes listRuntimeActionSchemas without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + ]; + client.innerApiCalls.listRuntimeActionSchemas = + stubSimpleCall(expectedResponse); + const [response] = await client.listRuntimeActionSchemas(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeActionSchemas without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + ]; + client.innerApiCalls.listRuntimeActionSchemas = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRuntimeActionSchemas( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.connectors.v1.IRuntimeActionSchema[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeActionSchemas with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRuntimeActionSchemas = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listRuntimeActionSchemas(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeActionSchemasStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + ]; + client.descriptors.page.listRuntimeActionSchemas.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRuntimeActionSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.RuntimeActionSchema[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.RuntimeActionSchema) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listRuntimeActionSchemas + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRuntimeActionSchemas, request) + ); + assert( + ( + client.descriptors.page.listRuntimeActionSchemas + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRuntimeActionSchemasStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeActionSchemas.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRuntimeActionSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.RuntimeActionSchema[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.RuntimeActionSchema) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listRuntimeActionSchemas + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRuntimeActionSchemas, request) + ); + assert( + ( + client.descriptors.page.listRuntimeActionSchemas + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeActionSchemas without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + ]; + client.descriptors.page.listRuntimeActionSchemas.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IRuntimeActionSchema[] = + []; + const iterable = client.listRuntimeActionSchemasAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRuntimeActionSchemas + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listRuntimeActionSchemas + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeActionSchemas with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeActionSchemas.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRuntimeActionSchemasAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IRuntimeActionSchema[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRuntimeActionSchemas + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listRuntimeActionSchemas + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('connection', () => { + const fakePath = '/rendered/path/connection'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + connection: 'connectionValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.connectionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.connectionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('connectionPath', () => { + const result = client.connectionPath( + 'projectValue', + 'locationValue', + 'connectionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.connectionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConnectionName', () => { + const result = client.matchProjectFromConnectionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.connectionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConnectionName', () => { + const result = client.matchLocationFromConnectionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.connectionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConnectionFromConnectionName', () => { + const result = client.matchConnectionFromConnectionName(fakePath); + assert.strictEqual(result, 'connectionValue'); + assert( + (client.pathTemplates.connectionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('connectionSchemaMetadata', () => { + const fakePath = '/rendered/path/connectionSchemaMetadata'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + connection: 'connectionValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.connectionSchemaMetadataPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.connectionSchemaMetadataPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('connectionSchemaMetadataPath', () => { + const result = client.connectionSchemaMetadataPath( + 'projectValue', + 'locationValue', + 'connectionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.connectionSchemaMetadataPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConnectionSchemaMetadataName', () => { + const result = + client.matchProjectFromConnectionSchemaMetadataName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.connectionSchemaMetadataPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConnectionSchemaMetadataName', () => { + const result = + client.matchLocationFromConnectionSchemaMetadataName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.connectionSchemaMetadataPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConnectionFromConnectionSchemaMetadataName', () => { + const result = + client.matchConnectionFromConnectionSchemaMetadataName(fakePath); + assert.strictEqual(result, 'connectionValue'); + assert( + ( + client.pathTemplates.connectionSchemaMetadataPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('connector', () => { + const fakePath = '/rendered/path/connector'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + provider: 'providerValue', + connector: 'connectorValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.connectorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.connectorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('connectorPath', () => { + const result = client.connectorPath( + 'projectValue', + 'locationValue', + 'providerValue', + 'connectorValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.connectorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConnectorName', () => { + const result = client.matchProjectFromConnectorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.connectorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConnectorName', () => { + const result = client.matchLocationFromConnectorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.connectorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProviderFromConnectorName', () => { + const result = client.matchProviderFromConnectorName(fakePath); + assert.strictEqual(result, 'providerValue'); + assert( + (client.pathTemplates.connectorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConnectorFromConnectorName', () => { + const result = client.matchConnectorFromConnectorName(fakePath); + assert.strictEqual(result, 'connectorValue'); + assert( + (client.pathTemplates.connectorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('connectorVersion', () => { + const fakePath = '/rendered/path/connectorVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + provider: 'providerValue', + connector: 'connectorValue', + version: 'versionValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.connectorVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.connectorVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('connectorVersionPath', () => { + const result = client.connectorVersionPath( + 'projectValue', + 'locationValue', + 'providerValue', + 'connectorValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.connectorVersionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConnectorVersionName', () => { + const result = client.matchProjectFromConnectorVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.connectorVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConnectorVersionName', () => { + const result = client.matchLocationFromConnectorVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.connectorVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProviderFromConnectorVersionName', () => { + const result = client.matchProviderFromConnectorVersionName(fakePath); + assert.strictEqual(result, 'providerValue'); + assert( + (client.pathTemplates.connectorVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConnectorFromConnectorVersionName', () => { + const result = client.matchConnectorFromConnectorVersionName(fakePath); + assert.strictEqual(result, 'connectorValue'); + assert( + (client.pathTemplates.connectorVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromConnectorVersionName', () => { + const result = client.matchVersionFromConnectorVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.connectorVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('provider', () => { + const fakePath = '/rendered/path/provider'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + provider: 'providerValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.providerPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.providerPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('providerPath', () => { + const result = client.providerPath( + 'projectValue', + 'locationValue', + 'providerValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.providerPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProviderName', () => { + const result = client.matchProjectFromProviderName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.providerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProviderName', () => { + const result = client.matchLocationFromProviderName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.providerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProviderFromProviderName', () => { + const result = client.matchProviderFromProviderName(fakePath); + assert.strictEqual(result, 'providerValue'); + assert( + (client.pathTemplates.providerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('runtimeConfig', () => { + const fakePath = '/rendered/path/runtimeConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.runtimeConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('runtimeConfigPath', () => { + const result = client.runtimeConfigPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.runtimeConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRuntimeConfigName', () => { + const result = client.matchProjectFromRuntimeConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.runtimeConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRuntimeConfigName', () => { + const result = client.matchLocationFromRuntimeConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.runtimeConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('settings', () => { + const fakePath = '/rendered/path/settings'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.settingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.settingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('settingsPath', () => { + const result = client.settingsPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.settingsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSettingsName', () => { + const result = client.matchProjectFromSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.settingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-connectors/tsconfig.json b/packages/google-cloud-connectors/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-connectors/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-connectors/webpack.config.js b/packages/google-cloud-connectors/webpack.config.js new file mode 100644 index 00000000000..e733962191b --- /dev/null +++ b/packages/google-cloud-connectors/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'Connectors', + filename: './connectors.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', +}; diff --git a/release-please-config.json b/release-please-config.json index 163156a4f54..b90c33b23a0 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -148,6 +148,7 @@ "packages/google-cloud-policytroubleshooter-iam": {}, "packages/google-cloud-config": {}, "packages/google-cloud-netapp": {}, + "packages/google-cloud-connectors": {}, "packages/google-cloud-policysimulator": {}, "packages/google-cloud-edgecontainer": {}, "packages/google-devtools-cloudprofiler": {},